USB · Storage
Fix a PC that cannot eject a USB drive because it is always 'in use'
Windows refuses to eject a USB drive while any program, window, or background service is touching a file on it — and something almost always is, from a forgotten Explorer window to the search indexer. Close the real holder, and if the message outlives everything you can see, sign out or restart rather than pulling the drive and risking the file that was open.
What you need
- A few minutes of patience. A drive that was just written to can need a short wait before it releases.
- Nothing extra to install. Every step uses tools already in Windows.
- Administrator access, only for the advanced steps.
Read the problem before you touch it
- Understand what 'in use' protects. Ejecting tells Windows to finish every write and close every open file on the drive before you remove it, as Microsoft sets out in Safely remove hardware in Windows. The refusal means at least one handle is still open. Pulling the drive anyway can corrupt the file that was open — the warning is doing its job, so the fix is finding the holder, not bypassing the check.
- Check the obvious holders first. Look for a File Explorer window showing the drive, a document or photo open from it, a media player pointed at it, or a backup or sync program mid-job. Explorer windows count even minimized and forgotten — and Microsoft's File Explorer in Windows is where to look for them, including the preview pane, which holds a file open just by showing it.
The simple fixes, in order
- Wait a minute, close the drive's windows, and try again. Close every File Explorer window showing the drive or any folder on it, click on the desktop so Explorer's focus moves elsewhere, wait a full minute for writes to finish, then eject from the system tray again. This clears the majority of cases.
- Close the program that used the file. If you opened anything from the drive — a document, a video, an installer — close that program completely, not just the file. Many programs keep the folder or file locked until the program itself exits.
- Sign out and back in if nothing visible is holding it. Signing out closes every program and handle in your session at once. Sign back in and eject the drive before opening anything. If it ejects now, a background process in your session was the holder — annoying, but the drive and PC are both healthy.
The advanced route
- Restart if signing out does not release it. A service or a crashed program can hold a handle outside your session. A restart clears every handle on the PC. Eject the drive early after the restart, before launching the apps that usually touch it. If one app reliably re-locks the drive, you have found your culprit by timing — Microsoft's guidance on the drive side is in Disk Management in Windows, where the drive's state can also be checked.
- Stop the indexer and antivirus from scanning it, if it happens every time. If this drive is refused on every eject, Windows Search indexing or an antivirus scan is the likely permanent holder. In Indexing Options, exclude the drive's letter, and let any antivirus scan of the drive finish before ejecting. The pattern to recognize is timing: a drive that ejects fine after ten idle minutes was being scanned, not broken.
- Check the drive's health if files on it also misbehave. A drive that will not eject and also throws errors opening files may be failing. Copy everything you need off it first — before any repair attempt — and only then consider checking it. Data first, diagnosis second, on any drive that holds the only copy of anything.
End state
- The drive ejects from the system tray with the 'safe to remove' message.
- No file on the drive is damaged or missing after removal.
- You know which program or service was holding it, if it happens again.
When it goes wrong
- It still refuses after a restart, before you open anything. A startup program is grabbing it — backup and sync tools are the usual ones. Pause them one at a time and test the eject.
- You pulled it anyway and now a file is damaged. That is exactly the failure ejecting prevents. Restore that file from its other copy if one exists, and treat the drive gently until its contents are backed up.
- The eject option itself is missing. Use the system tray's safely-remove icon, or right-click the drive in File Explorer and choose Eject there. If neither exists, sign out, wait for the drive light to stop, and only then remove it.
Related fixes
-
Fix a file or folder that will not delete because it is open in another program
The 'open in another program' message means some process is holding the file open — often not the app you expect. Find the holder in Resource Monitor, close just that process or handle, and delete the file without a restart or a forced-delete tool.
-
Fix a scanner that Windows detects but scanning apps cannot use
When Windows can see a scanner but no app can scan with it, the break is usually the scanning service, the driver model the app expects, or the maker software fighting Windows for the device. Test with the built-in scan app first, restart the service next, then sort out the driver.
-
Fix an external hard drive or USB drive not showing up in File Explorer
The drive connects but no letter appears in File Explorer. Find it in Disk Management, bring it online, assign a letter, and check the volume.
-
Fix a USB drive that shows as read-only or write-protected
A USB drive that refuses every write is usually carrying a read-only attribute, a physical lock switch, or a file system error — and sometimes it is failing. Copy anything you need off it first, then clear the attribute and check the file system.
Sources
- Microsoft Support, Safely remove hardware in Windows — the eject route and what Windows finishes before a drive can be removed.
- Microsoft Support, File Explorer in Windows — finding the Explorer windows and preview panes that hold files open.
- Microsoft Support, Disk Management in Windows — checking the drive and its state from Windows' disk tools.