Command Prompt Command to:

  • Thread starter Thread starter Bob Felton
  • Start date Start date
B

Bob Felton

By chance is there a command prompt command that can be run from a
batch file that allows removing a connected USB device safely? I'm
thinking of using a USB HDD for unattended backup. The drive will be
connected via a USB cable but AC power to it will be turned ON and OFF
via a timer function (so the drive doesn't spin when not in actual
use). Manual testing of AC power ON and OFF seems to work OK but at
times a message pops up saying the device was disconnected in an usafe
manner. I'm thinking of running the requested command upon completion
of the backup so when the timer kicks in and turns the drive OFF it is
done so in a safe manner. Tnx!
 
For all possible DOS (or emulated DOS) commands under XP get the book
"Windows Command Line" ISBN 0-7356-2038-5 and see if what you want to do is
possible.
 
Bob Felton said:
By chance is there a command prompt command that can be run from a
batch file that allows removing a connected USB device safely? I'm
thinking of using a USB HDD for unattended backup. The drive will be
connected via a USB cable but AC power to it will be turned ON and OFF
via a timer function (so the drive doesn't spin when not in actual
use). Manual testing of AC power ON and OFF seems to work OK but at
times a message pops up saying the device was disconnected in an usafe
manner. I'm thinking of running the requested command upon completion
of the backup so when the timer kicks in and turns the drive OFF it is
done so in a safe manner. Tnx!

The devcon utility can be used in a batch file to disable the device but
that may not be any better than cutting the power and it will need
administrator privileges to run.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272
 
Oops! I posted this to the wrong group. It should have gone into the
Windows 2000 group as I want to do this on a machine running Windows
2000 Server. Thanks for your responses. Are your comments still
applicable against Windows 2000 Server? Tnx!
 
Absolutely. MS has put a lot of effort into making machines (especially
servers) capable of being administered via scripts, and the buzzword is
"scripting". You write VB scripts, using an object model which gives you
access to elements of the OS, and wrap it up using "Windows Script Host".
 
Thanks, Philip. I give scripting a looksee.



Absolutely. MS has put a lot of effort into making machines (especially
servers) capable of being administered via scripts, and the buzzword is
"scripting". You write VB scripts, using an object model which gives you
access to elements of the OS, and wrap it up using "Windows Script Host".
 
Back
Top