Reputation: 9880
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.
Upvotes: 4
Views: 1077
Reputation: 52679
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.
Upvotes: 2
Reputation: 8981
Solution without any popping dialogs:
just use
sync
from cygwin (sync is utility from coreutils)
Upvotes: 2