Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Safely Remove Hardware by script?

Status
Not open for further replies.

wcburton

IS-IT--Management
Apr 4, 2002
269
US
I have been using sync.exe from sysinternals to flush and eject removable media. I know that you can also do this from the icon in the system tray which brings up the "Safely Remove Hardware" dialog box.

I would like to do this from a script. Can someone give me a starting point? I would then need to trap if the drive could not be ejected because a process still has a file open on the removable media.

I got some results searching MS Scripting Center to determine (enumerate) the logical drive properties, but nothing on methods to do the above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top