Sometimes, when trying to eject (remove) an external USB hard drive, Windows 7 issues the following error:

Problem Ejecting USB Mass Storage Device

Windows can't stop your 'Generic volume' device because a program is still using it. Close any programs that might be using the device, and then try again later.

This question addresses this issue when it happens in Windows XP or Windows Vista. Are there better techniques to use in Windows 7 SP1, preferably something that does not require a closed-source third-party tool?

Things I have tried:

  • Closing all applications.
  • Letting the system sit for 5 minutes to finish any outstanding NTFS journal writes.
  • Disabling Windows indexing.
  • Ensuring that there are no shares.
  • Temporarily disabling antivirus.
  • Using USB Disk Ejector (did not help).
  • Putting the system in sleep mode and then waking it up.
  • Using SysInternal's Process Explorer to see if any processes are using the drive.

My technique in the past was to turn off the system, but chkdsk often detects errors after doing this.

  • First you need to know what exactly causes the problem. Start sysinternals process explorer and do a search your usb hdd drive letter (for example: f: ). Which processes use the drive? – Jack White Jul 20 '16 at 23:55
  • Thanks Jack. Process Explorer turned up nothing using it. – RockPaperLizard Jul 21 '16 at 1:38
  • Completely killing and restarting Windows Explorer always does the trick for me. On the rare occasion that it does not, logging off and then logging back on will take care of it (no restart required) – InterLinked Jul 21 '16 at 1:40
  • @InterLinked Thanks! Next time it happens, I will try both of those suggestions. Would you like to turn your comment into an answer, or would you prefer I create an answer with those tips? – RockPaperLizard Jul 21 '16 at 2:24
  • I forgot to tell you to run Process Explorer by right-clicking the downloaded file and selecting Run as administrator. Please launch it like that and try searching again. – Jack White Jul 21 '16 at 11:39

Here are some steps you can take:

  1. Completely restart Windows Explorer. To do this, press WIN+Shift+Esc to open Task Manager. Then, locate explorer.exe in Details and kill the process. Click New Task, type 'explorer' and hit Enter. Alternatively on Windows 10, you can also try right-clicking Windows Explorer on the processes tab and clicking Restart
  2. Try closing the application that was using the USB. Somtimes, if I edit a file in Word on a flash drive and then start doing something else in Word, completely closing Word will free it up for whatever reason.
  3. If the above does not work, try logging off and then logging back on. This is a last-resort but it most certainly will work. No restart is nessecary. Be careful about restarting with a USB in - if your PC is set to boot from USB, you will get a No OS detected error
  • It is worth adding that a program having current directory pointed to the USB drive will cause this. For some programs like total commander it is obvious where the current directory is. For some others like word or photoshop it is not - but often it is the directory from/to which a file was last opened/saved manually by using "Open file" or "Save as" dialog window. If you were working with a file on the USB in some program try manually opening a file from your c:\ to reset the current directory. – Jack White Jul 21 '16 at 11:13
  • @JackWhite Will closing the program work just as well? – RockPaperLizard Jul 21 '16 at 19:42
  • Is it best to kill Windows Explorer using End Process or End Process Tree? – RockPaperLizard Jul 21 '16 at 19:43
  • Yes, closing the program will work for sure in this case - what is outlined in this answer is enough. My point is that very often it is not necessary to close all the programs that might be responsible - just changing active directory is enough - even closing files opened from the USB is not always required (unless the file is locked like Word and Excel do). – Jack White Jul 21 '16 at 22:47
  • Do NOT use End Process Tree on Windows Explorer - doing so will most likely terminate all programs running in your session. – Jack White Jul 21 '16 at 22:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.