Home »
Hardware
»
USB and 1394 Interfaces
Read the article that everyone's commenting on.
Subscribe to the RSS Feed for comments on this article.
The batch file sounds like a good solution & I'll certainly try, but is there a way to find out what program is still accessing the drive?
I have a USB Apricorn portable HDD for backups & to take files home from work & viceversa. At home (XP Home) I rarely have a problem, but at work (W2K) too frequently I'm unable to "safely remove" it unless I reboot the machine. The access light is not on & it may be some time since I've used it at all. Waiting a while (even hours) doesn't help. Of the times I've unplugged it anyway, maybe half of them I get a warning that some process didn't finish, no mention of exactly which or what program. Closing every program running (that I can see) is no help either.
To date I haven't found any of my files in the portable missing or damaged, but I need to know what's accessing it without my authorization. We have a good firewall & virus protection, but since it's a work computer you never know what else is there. Virus & spyware check are all ok.
Many thanks.
Rosie
Posted by: Rosie at February 1, 2006 11:10 AMTreat the drive letter ("e:" for example) as if it were a file name and search for it using the intructions with this article: http://ask-leo.com/how_can_i_find_out_who_is_using_a_file_in_use.html
Posted by: Leo at February 1, 2006 12:18 PMIs there a way to do it the other way around? When I plug my iPod, iTunes is supposed to start as well, but it doesn't. So Is there a way to trigger iTunes when I plug he iPod?
Posted by: pitbull at February 7, 2006 6:26 PMMy "Safely Remove Hardware" icon (Windows XP)has disappeared and I've tried everything I know of to restore it to the taskbar. In the taskbar Properties I have it flagged as "Always Show" along with other icons, but it does not appear in the taskbar when using any USB device
Posted by: Nikola at February 20, 2006 12:52 AMDoesn't work! Not for me. Looks like "devcon remove" causes the device in question to be uninstalled -- which is not desired, and does NOT cause it to be "unplugged" -- which -is- desired.
In other words, after using "devcon remove" the device is completely gone from the device manager (even in "show hidden" mode) but I still get the "Unsafe Removal" error (albeit with different device syntax) when I physically unplug the device. (I may be getting the Unplug error because the related drivers -- the "Generic volume" driver and the "USB Mass Storage Device" driver are still in the stack.)
When I plug the device back in I get a "Found new hardware" sequence because the drivers had been (undesireably) uninstalled.
And methinks that uninstalling a device may be actively dangerous -- it may NOT wait to flush disk buffers, since it's not an "unplug". Using this removal method may cause you to lose data. I would avoid it until this is clarified.
I tested with two different plug-in drives, under Win2000 SP4. I have no idea why the method apparently does work for Leo!
Posted by: Garry W at February 28, 2006 8:51 PMFound one that works better! It seems that, in Windows terms, you want an "Eject", not a "Remove", of the device.
To do that, grab 'deveject' from ftp://ftp.heise.de/pub/ct/listings/0316-208.zip. To "safely remove" drive letter 'X:', the syntax would be "deveject -EjectDrive:X:". This method does NOT uninstall the whole device, does NOT truncate writes-in-progress, does NOT lose the drive lettering (if you've set it), DOES really get rid of the "Unsafe Removal" messages. Good.
And for extra credit, "unmount.exe" from http://www.uwe-sieber.de/files/unmnt10.zip will wait for open files to close. Syntax is "unmount -e X:". Run it first, then do the deveject. (There is an "eject" built into unmount.exe, but it's not the right one.)
Posted by: Garry W at February 28, 2006 9:55 PMI'm agree with Tintin, DevEject seems to be better solution. No installation is needed, so we can just copy it and write .bat file - something like this: deveject -EjectId:usbstor\*. We can also make shortcut to DevEject and add the parameter to its properties (something like this: ["C:\Documents and Settings\Admin\deveject.exe" -EjectId:usbstor\*] ).
A bit of problem - if drive is in use and cannot be ejected, DevEject will not in fact eject it, but will keep silence on it (report it's done). If you have not the icon in your deskbar, you probably will not notice it and will have true chance to corrupt your data.
Posted by: coodan at May 1, 2006 11:36 AMIs it possible to put the 'disconnect' command (any of the above methods) in a .bat file that is on the drive that I am trying to remove.
Posted by: carenza at June 19, 2006 9:50 AMI don't see why not. The batch file would terminate abruptly, since it would "disappear" while it was running.
Alternative is to have the batch file copy itself to the %TMP% location, and then run itself from there, deleting itself on completion.
Posted by: Leo A. Notenboom at June 19, 2006 3:58 PMIs there a way to stop the usb drive to safely remove it? At college, I frequently use computers on which I have limited access, and if the "safely remove" icon is not there, I cannot adjust the settings on the computer. I have to completely shut down the computer to stop the drive. Also, if the drive is "optimized for quick removal", does the drive need to be stopped before it is removed? The light on the drive stays on until I pull it out (that is, if I don't stop it before removing it), which seems to me like a bad thing.
Posted by: Jared at September 7, 2006 6:58 PMTo post a comment on "Is there a way to "Safely Remove Hardware" from a batch file?", please return to that article's main page.