programmatically stop a USB device?

  • Thread starter Thread starter JM7
  • Start date Start date
J

JM7

Is there a way to programmatically stop a USB device, ie "Safely remove
hardware".

It could be in VB Script, batch file DOS commands or even VB6 Code.

The whole process of doing it from the Task bar is quite tedious.

Many thanks,

--
 
JM7 said:
Is there a way to programmatically stop a USB device, ie "Safely
remove hardware".

It could be in VB Script, batch file DOS commands or even VB6 Code.

The whole process of doing it from the Task bar is quite tedious.
Hi,

To automate this, you can use deveject.exe available here (includes
C++ source code as well):

ftp://ftp.heise.de/pub/ct/listings/0316-208.zip

For help, run deveject.exe /? in a command prompt.

Works for Windows 2000/XP/2003.


An example using the EjectName command line switch:
deveject.exe -EjectName:"USB Mass Storage Device"
 
Thank you so much - that was a brilliant find

Torgeir Bakken (MVP) said:
Hi,

To automate this, you can use deveject.exe available here (includes
C++ source code as well):

ftp://ftp.heise.de/pub/ct/listings/0316-208.zip

For help, run deveject.exe /? in a command prompt.

Works for Windows 2000/XP/2003.


An example using the EjectName command line switch:
deveject.exe -EjectName:"USB Mass Storage Device"



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
 
Back
Top