Disconnecting USB Devices from within a script

  • Thread starter Thread starter R. Seiler
  • Start date Start date
R

R. Seiler

I am setting up a script to use xcopy to backup files nightly to an external
USB drive.
Is there a way to disconnect USB Devices from within a script so that there
is no need for user intervention?
or - can it be dune with someting that I can compile in C?

Thanks in advance for any advice.
 
R. Seiler said:
I am setting up a script to use xcopy to backup files nightly to an external
USB drive.
Is there a way to disconnect USB Devices from within a script so that there
is no need for user intervention?
or - can it be dune with someting that I can compile in C?

Thanks in advance for any advice.
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

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