1.

Solve : Detect and Eject Removable Disk in cmd?

Answer»

hi
how can i create the batch file to detect and eject removable drive automatically ?
tnxsomething like this?
http://www.911cd.net/forums//index.php?s=924b5513860a93a2c9bef812b0718a05&showtopic=13917&pid=132133&st=0&#entry132133tnx for reply,
but i want to detect usb mass drive and eject it. (something like safe REMOVE!) Quote from: rockhudson on July 28, 2011, 10:36:39 AM

Wlll not eject automatically. USB stick is safe to remove manually at any time.

That advice is reckless. Delayed write and programs that have a file open on the device will not take too kindly to your yanking the device from the port.

Could not find a script to do a safe remove but you can enter this command in a batch file which will present the GUI:

Code: [Select]RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll

There are also third PARTY programs which claim to ACCOMPLISH this. Google will be helpful here.

Good luck.

BTW: Didn't Rock Hudson die some years ago. Good to see the cemetery crowd on CH.Quote
Wlll not eject automatically. USB stick is safe to remove manually at any time.

Agreed ...shifty advice at best.Quote from: behad-007 on July 27, 2011, 02:44:33 AM
Tnx for reply,
but i want to detect usb mass drive and eject it. (something like safe remove!)

Transfusion wrote:
"Something like this?
http://www.911cd.net/forums//index.php?s=924b5513860a93a2c9bef812b0718a05&showtopic=13917&pid=132133&st=0&#entry132133"

The Transfusion method Is for a CD drive with a door. The OP,behad-007, is concerned with a USB storage device.

_______________________________________ ______

There is safely remove USB icon at the lower right.

Remove USB drive when Safely Remove Hardware icon APPEARS at the lower right.Quote from: Fred35 on July 28, 2011, 05:46:31 PM
Transfusion wrote:
"Something like this?
http://www.911cd.net/forums//index.php?s=924b5513860a93a2c9bef812b0718a05&showtopic=13917&pid=132133&st=0&#entry132133"

The Transfusion method Is for a CD drive with a door. The OP,behad-007, is concerned with a USB storage device.

_______________________________________ ______

There is safely remove USB icon at the lower right.

Remove USB drive when Safely Remove Hardware icon appears at the lower right.

_______________________________________ _____
When icon does not appear do:

RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll

http://ask-leo.com/safely_remove_hardware_where_did_the_icon_go_how_do_i_safely_remove_hardware_without_it.htmlthanks to all for reply,
this code was very helpful

RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll


Discussion

No Comment Found