- Is there a commandline "dismount" command for USB external drives?
- Posted by Al Dykes on February 26th, 2006
I want to script an xcopy command and then dismount the USB drive. Is
there a hack to do this?
I expect the "mount" will be automatic when I physically unplug and
then replug the drive.
One of these days, Windows will be "finished".
Thanks
--
a d y k e s @ p a n i x . c o m
Don't blame me. I voted for Gore.
- Posted by Carey Frisch [MVP] on February 26th, 2006
No.
- Posted by Pegasus \(MVP\) on February 26th, 2006
"Al Dykes" <adykes@panix.com> wrote in message
news:dtt5rd$gnc$1@panix5.panix.com...
deveject.exe works very nicely. You can get it from here:
http://www.heise.de/ct/03/25/links/206.shtml
You could also use devcon.exe from the Windows Resource
Kit to disable the USB device. However, you will then have
to re-enable it before using it.
- Posted by Uwe Sieber on February 27th, 2006
Pegasus (MVP) wrote:
This tool (c't deveject) works with drives only that have
a drive type DRIVE_REMOVABLE. The are some USB flash drives
and lots of USB hard drives that have DRIVE_FIXED.
And it is written for Windows 2000. Under XP it reports
always success even when it failed because Microsoft has
changed the API.
My tool works better in most cases :-)
http://www.uwe-sieber.de/files/removedrive.zip
Greetings from Germany
Uwe
- Posted by Pegasus \(MVP\) on February 27th, 2006
"Uwe Sieber" <mail@uwe-sieber.de> wrote in message
news:46gbk3Fad5pmU1@individual.net...
This sounds interesting. I put it to the test by doing this:
1. Determine the name of the USB device I wish to
disconnect, using the "Safe Removal dialog". It is
"USB Mass Storage Device".
2. Attempt to disconnect it with this command:
deveject -EjectName:"USB Mass Storage Device"
DevEject 1.0 2003 c't/Matthias Withopf
Ejecting 'USB Mass Storage Device'
[USB\VID_10D6&PID_1000\5&1719D762&0&1]...ok.
1 device(s) ejected.
3. Unplug the USB device, plug it back in again, ensure
that Windows recognises it.
4. Attempt to disconnect it with this command:
removedrive "USB Mass Storage Device"
RemoveDrive V0.8 - removes removable drives
Freeware by Uwe Sieber - www.uwe-sieber.de
Removing Device 'USB Mass Storage Device'Device not found!
failed
Either removedrive.exe has some teething problems or
my WinXP Professional installation is one of those cases
where deveject.exe works better than removedrive.exe.
- Posted by Uwe Sieber on February 27th, 2006
"USB Mass Storage Device" is the device class, not the
device name. c't deveject looks for device classes too.
Using "USB Mass Storage Device" would remove all you
USB drives.
I've seen no use for removing all USB drives.
RemoveDrive works with drive letters, other mount points
and device names only.
You are right. This is one case where c't deveject is
better :-)
Greetings from Germany
Uwe
- Posted by Pegasus \(MVP\) on February 27th, 2006
"Uwe Sieber" <mail@uwe-sieber.de> wrote in message
news:46gocvFb020aU1@individual.net...
I tried "removedrive G:", and this time it worked. I shall
now try the command in a few different environments.