What you're seeing
You plug in an external drive, use it, then try to eject — and Windows throws STATUS_FILES_OPEN (0XC0000107). The notification says “Problem Ejecting USB Mass Storage Device” or something similar. What's actually happening here is that one or more processes still have handles open to files on that drive. Windows won't let the drive go because it's paranoid about data corruption. Makes sense, but it's annoying when you know you're done with it.
Fastest try (30 seconds) – Reboot or sign out
This feels stupid, but it works more often than you'd think. The reason step 3 works is: when you reboot or log off, every user-mode process closes its handles. The kernel flushes them too. So if the blocker is something like a random Explorer window still referencing a thumbnail cache or a leftover command prompt, you're done.
- Close all open windows, especially File Explorer tabs pointing to that drive.
- Click the “Safely Remove Hardware” icon in the system tray and try again.
- If it fails again, restart your PC or sign out and back in. Then try ejecting immediately — before you open anything on the drive.
Moderate fix (5 minutes) – Find the culprit with built-in tools
If rebooting feels like overkill or you can't right now, let's find what's holding the drive. Windows gives you two ways to do this. I'll give you both.
Method A: Use the command line (fast, no install)
- Open Command Prompt as admin. (Hit Win, type
cmd, right-click, “Run as administrator”.) - Figure out the drive letter for the external drive. Say it's
F:. - Run this to see all open handles on that drive:
handle -a -p -nobanner F:
Wait — that requires handle.exe from Sysinternals, which you don't have yet. Let me correct myself. The built-in alternative is openfiles:
openfiles /query /s localhost /u %username%
But honestly, openfiles requires the “Maintain Objects List” global flag to be enabled, which it's not by default. So this method is a dead end unless you've already turned that on. Skip it.
Method B: Use Process Explorer (the real fix)
Download Process Explorer from Microsoft's site — it's portable, no install needed. Unzip and run procexp64.exe as admin.
- In Process Explorer, press Ctrl+F to open the “Find Handle or DLL” dialog.
- Type your drive letter with a colon and backslash —
F:\— and hit Search. - List will populate with every process that has an open handle on that drive. You'll see things like
explorer.exe, maybe a media player, maybe a backup tool, maybe a virus scanner. - Double-click each entry to jump to the process. Then right-click the process and select Close Handle. You can do this for all of them.
- Try ejecting now. It should work.
If the process is something you don't want to kill — like a backup software that's mid-sync — wait for it to finish. Closing handles on a process that's actively writing can corrupt data. Use common sense.
Advanced fix (15+ minutes) – When the process refuses to let go
Sometimes the culprit is a system service or something that immediately reopens the handle after you close it — like a file indexer or a syncing tool. In that case, you need to stop the service temporarily, or use handle.exe from the command line to force-close with more control.
Stop the offending service
- From Process Explorer's search, note the process name. Is it
SearchIndexer.exe? That's Windows Search. Is itsvchost.exehosting theStorSvcservice? That's the Storage Service. - Open Services (type
services.mscin Run). Find the service, right-click, and Stop it. - Try ejecting immediately. Afterward, restart the service or reboot to restore normal operation.
Use handle.exe to force-close by PID
If you prefer the command line, grab handle.exe. Run as admin:
handle -a -p F:
This prints all handles on F: with their process IDs. For each one you want to close, note the handle number (the hex value in brackets after the file path). Then:
handle -c <handle-number> -p <PID> -y
The -y suppresses the confirmation prompt. For example:
handle -c 0x000001234 -p 5678 -y
This is faster than Process Explorer's GUI if you know what you're doing. But be warned: force-closing a handle on a process that's in the middle of writing can cause corruption. Only do this when you're sure the file is not being actively modified.
Last resort: Disable the drive in Device Manager
If nothing works, you can force Windows to stop using the drive at the hardware level. This is a nuclear option — you might lose unsaved data.
- Open Device Manager (Win + X, select Device Manager).
- Expand Disk drives. Find your external drive.
- Right-click it and select Disable device. Confirm.
- Windows will immediately stop talking to it. You can now unplug it. Later, re-enable it from the same menu.
This works because disabling the device forces the driver to revoke all outstanding handles. The drive's file system is unmounted instantly. If any application had a file open, it'll get an error next time it tries to read or write — but no data is lost if nothing was actively being written.
Prevention: Stop it before it starts
The real fix is to close your programs properly before ejecting. Always check that no media player, file manager, or backup tool has that drive open. Also disable “thumbnail previews” in File Explorer for external drives — sometimes Explorer holds a handle just to generate thumbnails.
To do that, open File Explorer, go to View → Options → View tab, and check Always show icons, never thumbnails. That alone prevents Explorer from opening files just to look at them.