Disconnecting USB Devices from within a script

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.
 
T

Torgeir Bakken \(MVP\)

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"
 
R

R. Seiler

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top