Sign in with
Sign up | Sign in
Your question

programmatically stop a USB device?

Last response: in Windows XP
Share
Anonymous
a b \ Driver
July 11, 2005 12:31:20 PM

Archived from groups: microsoft.public.windowsxp.device_driver.dev,microsoft.public.windowsxp.general,microsoft.public.windowsxp.hardware (More info?)

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,

--
July 11, 2005 12:31:21 PM

Archived from groups: microsoft.public.windowsxp.device_driver.dev,microsoft.public.windowsxp.general,microsoft.public.windowsxp.hardware (More info?)

Try it as a toggle VB Script.

--

All the Best,
Kelly (MS-MVP)

Troubleshooting Windows XP
http://www.kellys-korner-xp.com



"JM7" <one@hotmail.com> wrote in message
news:u4LFw8ZhFHA.1244@TK2MSFTNGP14.phx.gbl...
> 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,
>
> --
>
>
Anonymous
a b \ Driver
July 11, 2005 12:54:34 PM

Archived from groups: microsoft.public.windowsxp.device_driver.dev,microsoft.public.windowsxp.general,microsoft.public.windowsxp.hardware (More info?)

JM7 wrote:

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



--
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.m...
Related resources
Anonymous
a b \ Driver
July 12, 2005 12:17:03 AM

Archived from groups: microsoft.public.windowsxp.device_driver.dev,microsoft.public.windowsxp.general,microsoft.public.windowsxp.hardware (More info?)

Thank you so much - that was a brilliant find

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:#herHYehFHA.1948@TK2MSFTNGP12.phx.gbl...
> JM7 wrote:
>
> > 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"
>
>
>
> --
> 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.m...
July 13, 2005 4:31:36 AM

Archived from groups: microsoft.public.windowsxp.device_driver.dev,microsoft.public.windowsxp.general,microsoft.public.windowsxp.hardware (More info?)

Brilliant as always, Torgeir. :o )

--

All the Best,
Kelly (MS-MVP)

Troubleshooting Windows XP
http://www.kellys-korner-xp.com



"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:%23herHYehFHA.1948@TK2MSFTNGP12.phx.gbl...
> JM7 wrote:
>
>> 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"
>
>
>
> --
> 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.m...
!