Question

How can you shutdown a harddrive ? i want to do this to be able to safely remove my sata drive even though it's hotplug. WMI does't seems to have the method.

No correct solution

OTHER TIPS

Solution without any popping dialogs:

just use

sync

from cygwin (sync is utility from coreutils)

Using WMI, you can get the 'eject drive' dialog to pop up using:

Shell "Rundll32.exe Shell32.dll Control_RunDLLA hotplug.dll", vbNormalFocus

Alternatively, if you want to programatically eject a device, you need this MSDN article. This should work with sata drives, if you can eject them manually then you'll be able to 'eject' them programatically.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top