Using WMI, you can open the "Eject Disk" dialog box using:
Shell "Rundll32.exe Shell32.dll Control_RunDLLA hotplug.dll", vbNormalFocus
Alternatively, if you want to remove the device programmatically, you need this MSDN article . This should work with sata drives, if you can extract them manually, then you can “extract” them programmatically.
source
share