How do you disconnect a USB drive when getting a "this device is currently in use"?
You can use Unlocker to find out what program has it opened, then close that program. If you cannot exit the program, you can use Unlocker to force the handle closed.
If it is Windows Explorer, you can restart it. En easy way is to hold Control + Shift and right-click a blank area in the Start menu:
The key is to identify the process that has a directory open on the device you need to unmount (I've used the following on Windows 7).
- A search for warning Event ID 225 from Kernel-PnP in Windows Logs / System log file should find a message of the form "(something) stopped the removal or ejection for the device (something)".
This is already explained in the post:
Access "Computer Management" (right-click "Computer" / "Manage")
System tools -> Event viewer -> Windows Logs -> System
Use 'Find' to search for the event ID.
- You can also install Process Explorer to perform a search for the process or application:
Use that utility to search for a handle with the target drive letter (for example f: ), available under Find / Find handle or DLL ... That will help identify the offending process / PID, (similar to use of 'lsof' command under Linux), and the process can be stopped manually (e.g. using Task Manager or Process Explorer). You may need to run Process Explorer as Administrator if you are not the owner of the process.
I've found that some apps keep the directory open, even after a file has been saved and closed. Sometimes it is enough to open another file from your C: drive to reset the "current" directory for the app. Also, apps may still be running after the window has been closed. The searches above will help identify which app you need to stop.
Another option that does not require third party tools:
- Open "Disk Management" (aka "Create and format hard disk partitions")
- Locate the disk you want to eject from the lower-left stack of Disks.
- Right-click the disk and choose "Offline".
- You can then attempt again as normal to "Eject Device" from the system tray, which should now succeed.
One disadvantage to this approach is when you plug in again, you may have to go through the process to put the disk into Online mode.