Home All Groups Group Topic Archive Search About

Disconnecting USB Devices from within a script

Author
22 Jul 2005 6:07 PM
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.

Author
22 Jul 2005 6:09 PM
Torgeir Bakken (MVP)
R. Seiler wrote:

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



--
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
Are all your drivers up to date? click for free checkup

Author
23 Jul 2005 8:38 PM
R. Seiler
Thank you

Show quoteHide quote
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:esC48lujFHA.1232@TK2MSFTNGP15.phx.gbl...
> R. Seiler wrote:
>
>> 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"
>
>
>
> --
> 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

Bookmark and Share