How do you disconnect a USB drive when getting a “this device is currently in use” without Unlocker?

5

This question was asked three years ago and the suggested Unlocker has since (March 2015) been described by HowToGeek as only available with malware wrappers.

I need a methodology described to do it manually if there is no safe way to obtain a good utility. The Sysinternals tool seems too complicated, if I don't understand at all, how to use it. Logoff/Logon does not work. Even disabling antivirus (Malwarebytes Pro and Microsoft Security Essentials) does not help. This is both using an external hub and using the onboard USB ports.

This with SD Card Adapter, USB sticks, USB-HDD, etc. Help! I am using Windows 7 Professional 32-bit. Should I pull it out while logged off? How would I know it has been dismounted/ejected? But it is grabbed immediately after I log back in.


Responses to comments:

@fixer1234: I have corrupted USB flash drives by just pulling it out anyway. If terminating a process has the same effect, then how does Win7 actually ever make USB obey the request to eject (which it also has done in the past)? If it's been there for hours, and after refusing to "eject" I close ALL apps and close the AVs, and Log Off, then Log On, it still refuses.

As said in OP: several devices. If ALL apps are down, how can a service or process still be stopping eject?

To your question "Is there a particular situation you're trying to fix or do you need a general purpose way to terminate any active process, release the device and eject it?": The whole point is to right click on the USB in SysTray or Devices & Printers or even Explorer, to just eject it properly.

If a process is holding it and terminating that process is no better than just yanking it out or turning off the computer, then that is an OS bad design. Why doesn't whatever process finish?

It is NOT like I am in the middle of a multi-GB transfer. I think I have the caching option turned off anyway, to prevent this in the first place.

@DavidP: main drive is SSD and Sleep and Hibernate both disabled. This is a desktop. I said in OP: ALL apps were shut down etc.

@Richard: since the whole malware wrapper thing is spreading and sometimes by the site and sometimes by the dev themselves, I have had problems long ago with conduit and other sites. If I try Unlocker I will be needing to back up and make a comparison after, of the differences in the Reg and Temp files, and everywhere else I can think of. To just go ahead and trust them like I'm their puppy can be fine, or can cost me dearly.

@Nasreddine: I will try that, thanks, it was ProcessExplorer I was talking about. Guess I gotta to learn it after all.

DrWattsOn

Posted 2015-06-27T14:49:42.453

Reputation: 49

1The USB device could be idle but potentially waiting for a write cache to be cleared, it could be in active use, or it could be associated with a program that has failed to release it. Each condition requires a different action. Is there a particular situation you're trying to fix or do you need a general purpose way to terminate any active process, release the device and eject it? (And terminating a process, it could leave the device corrupted, or things in an unpredictable state that could require subsequent cleanup.) – fixer1234 – 2015-06-27T15:08:41.937

It would be helpful to include links to the HowTOGeek article and other information you cite so people can refer to them for context. – fixer1234 – 2015-06-27T15:12:05.240

You could try putting the computer in sleep mode. This should trun the USB drive off and it can then be unplugged. – DavidPostill – 2015-06-27T15:29:18.573

1If you make sure you uncheck the option to install the third party software during installation then you can safely continue to use Unlocker. – Richard – 2015-06-27T16:26:42.127

Related question

– K. Rmth – 2015-06-27T19:13:53.250

"I close ALL apps and close the AVs, and Log Off, then Log On, it still refuses." There are still processes and service running when you log off ... – DavidPostill – 2015-06-27T20:45:31.303

@DavidP's 6/27 response 20:45hrs: Yes. Obviously. Exactly stated in OP. So how is your comment helpful, in view of my posts? What exactly should I do in response to your statement "There are still processes and service running when you log off ... " when I what I ASKED proves I already know that ... where is your help in FINDING those processes which is what I ASKED. I mean, my OP (and editing) is RIGHT IN FRONT of you! I just don't get what you mean by your suggestions which suggest nothing, only tell me what I already know and STATED. – DrWattsOn – 2015-07-01T21:03:46.700

@DrWattsOn You are too focused on Applications. Try looking at the other tabs in Task Manager (guess what they are labelled "Processes" and "Services"). Any of those could be accessing your USB drive even if all applications except explorer are closed. – DavidPostill – 2015-07-01T21:23:48.167

@DrWattsOn You can also try Process hacker. It is much better than Task Manager. Not only does it display application and processes on the same tab (called "processes) but it will also tell you what processes have open file handles to your USB drive. Click on "Find Handles or DLLs", enter the drive letter of your USB (eg `f:) and press "Find".

– DavidPostill – 2015-07-01T21:39:48.290

1My experience is that often it is Explorer's fault, it seems it somehow forgets that it has locks on USB disks, and even killing the Explorer.exe doesn't release them. Sometimes it is an MSOffice-related background process that thinks it needs to look through the USB disks for any office files; I know to kill that one right away, that often helps. – Aganju – 2016-01-23T02:59:33.967

Answers

2

You can use Process Explorer to close handles that might be preventing you from ejecting the drive. The easiest way is to search for the assigned letter to your drive then right click and close the handle(s).

Example:

enter image description here

Nasreddine

Posted 2015-06-27T14:49:42.453

Reputation: 745

I have been doing that, but often it does not help either. – Aganju – 2016-01-23T02:51:29.467

@Aganju How exactly does it "not help"? I can't recall being unable to eject a drive after killing the offending handle or closing its parent process when using ProcExp. – millimoose – 2017-06-14T13:25:57.453

1@millimoose , some processes ignore the killing (they simply continue to exist); some give an error message that I cannot kill them; but most of the time the problem is that there are no handles associated with the drive and it still doesn't eject it. – Aganju – 2017-06-14T16:53:46.093

1

Safely Remove has never worked well, and Microsoft will probably never fix it. If the drive won't let go, just put your computer to Sleep, wait about 15 seconds till the USB drive light stops flashing, and then unplug it.

the original mike western

Posted 2015-06-27T14:49:42.453

Reputation: 1 159

It works perfectly well if you don't have applications running that are accessing the drive ... it doesn't need fixing. – DavidPostill – 2015-06-27T16:38:33.407

1David, I wouldn't be having a problem to post here, if " ... it doesn't need fixing." As STATED in OP, if every app is shut off except Explorer, which restarting in CLI does nothing but start a new window in Ms's xxxxing Libraries. Again you avoided the issue: If I cannot find an APPLICATION running in TaskMgmt, and shut off TaskMgmt and no open windows, even shut off AV's and still Safely Remove claims something has its hooks into the USB device ... why do you avoid addressing the plainly stated circumstances? Am I missing something you think is helpful in your posts to my maddening issue? – DrWattsOn – 2015-07-01T21:12:40.763

@DavidPostill, that is plainly wrong. I have the issue every other day, and I even tried by killing every single killable process (for all users) in the Task Manager, and it still claims it's in use. Of course, afterwards I need a reboot, but I was hoping to identify the guilty process, no luck. – Aganju – 2016-01-23T02:58:18.070

1@Aganju I have used many different USB drives here and all will eject normally. Clearly something is still accessing the drive in your case. You may have a problem identifying that something but that doesn't been eject is broken. – DavidPostill – 2016-01-23T09:43:53.853