If Windows 11 says “Problem Ejecting USB Mass Storage Device” or the drive stays in use, the fix is usually closing the program holding it open, or using a hidden system tool to force the lock to release. Start with the quick steps below, then work through the deeper fixes if the drive still refuses to eject.
Why Windows Refuses to Eject a USB Drive
Windows blocks ejection when it believes a file on the drive is still open. This is a safety mechanism: removing a drive with an active read or write operation can corrupt the file system, causing data loss that may require reformatting. The lock is held by a process, not by the drive itself. Common culprits include File Explorer windows showing the drive’s contents, antivirus scanners, backup software, media players, or a background service like Windows Search indexing the drive.
Another layer is the write-caching policy. By default, Windows uses “Quick removal” for most USB drives, which disables write caching and lets you unplug without ejecting. However, if the drive was set to “Better performance” (which enables write caching), you must eject it properly so Windows can flush cached data to the drive. If you skip this, you risk losing recent file changes.
Quick Fixes to Try First
These take less than a minute and resolve most cases.
- Close all File Explorer windows that show the drive. Even an empty window pointing at the drive can hold a lock.
- Close any program that might access the drive: media players, photo editors, backup tools, or terminal windows with the drive as the current directory.
- Wait a few seconds and try ejecting again. Some operations finish and release the lock on their own.
- Use the taskbar icon: click the small up arrow (Show hidden icons), right-click the USB icon, and select “Eject.” If that fails, the system will tell you which program is using it, if it can identify one.
- Restart Windows Explorer (not your PC): press Ctrl+Shift+Esc to open Task Manager, find “Windows Explorer” under Processes, right-click it, and choose “Restart.” This releases many stale locks.
Using the Disk Management Tool
If the quick fixes fail, the Disk Management snap-in can often release the drive without a reboot.
- Press Win + X and select “Disk Management.”
- Find your USB drive in the lower list (it will be labeled Removable, usually Disk 1, 2, etc., and show its capacity).
- Right-click the drive’s partition (the blue bar) and choose “Delete Volume.” Warning: this erases all data on the drive. Only use this if you have copied the data elsewhere and are prepared to reformat.
- After deletion, right-click the unallocated space and choose “New Simple Volume” to reformat it. This forces Windows to drop every lock.
This is a last resort because it destroys data. A less destructive option is to restart the PC, which clears all file handles.
Using the Hidden “Safely Remove Hardware” Dialog
Windows 11 hides the classic Safely Remove Hardware dialog, but it still exists and sometimes works when the taskbar icon fails.
- Press Win + R, type
RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll, and press Enter. - In the dialog, select your USB drive from the list and click “Stop.”
- If it says “The device cannot be stopped right now,” it will list the program holding it. Close that program and try again.
This dialog is more verbose than the taskbar icon and often reveals the exact process name, which helps you target the fix.
Finding and Closing the Locking Process
When the system won’t name the culprit, you can find it manually. The free Microsoft tool Handle (from Sysinternals) lists which processes have files open on a given drive.
- Download Handle from the Microsoft Sysinternals site and extract it to a folder.
- Open Command Prompt as administrator (search “cmd,” right-click, “Run as administrator”).
- Navigate to the folder with Handle, then run:
handle.exe [drive letter]:(e.g.,handle.exe E:). - Note the process name and PID that appears. Open Task Manager, find that process, and end it. If it’s a system service, you may need to stop the service or restart the PC.
This method is precise but requires a bit of comfort with the command line. If you prefer a graphical tool, third-party utilities like “USB Safe Unplug” or “LockHunter” can do the same with a right-click menu, though they are not built into Windows.
Adjusting Write-Caching Policy to Prevent Future Issues
You can change the drive’s policy so it never needs a formal eject. This is safe for most users and is actually the default on many systems.
- Right-click the Start button and select “Device Manager.”
- Expand “Disk drives,” right-click your USB drive, and choose “Properties.”
- Go to the “Policies” tab. Select “Quick removal” (this disables write caching and lets you unplug anytime).
- Click OK. If the drive is currently in use, you may need to restart the PC for the change to apply.
Note that “Quick removal” slightly slows down large file transfers because Windows doesn’t buffer writes. For most everyday use, the difference is negligible. If you choose “Better performance” instead, you must always use Safely Remove Hardware before unplugging.
When All Else Fails: Restart or Force Unplug
If you cannot identify the locking process and Disk Management is too destructive, the safest remaining option is to restart Windows. A full restart clears every file handle and releases the drive. After reboot, you can eject normally.
Force-unplugging without ejecting is only acceptable if you have confirmed the drive’s policy is “Quick removal” and you haven’t written files in the last few seconds. If the drive is set to “Better performance,” unplugging mid-write can corrupt data. If you must unplug and the drive is stuck, first copy any critical files elsewhere, then unplug. There is a small chance the drive will need a scan or repair afterward; Windows will usually prompt you to do this automatically.
Frequently Asked Questions
Why does Windows say the device is still in use when nothing is open?
Background services often hold locks silently. Windows Search indexing, antivirus real-time scanning, or a cloud sync client (like OneDrive) can access the drive without showing a window. The Handle tool or a restart will reveal or clear these hidden locks.
Is it safe to just pull out the USB drive?
Only if the drive is set to “Quick removal” (the default) and you haven’t written to it in the last few seconds. If it’s set to “Better performance,” pulling it out risks data corruption because cached writes haven’t been flushed. Check the Policies tab in Device Manager to be sure.
Will deleting the volume in Disk Management erase my files?
Yes, deleting the volume erases all data on that partition. Only use this method if you have backed up the files or no longer need them. After deletion, you must create a new volume and reformat the drive before it can be used again.
Why does the eject icon disappear from the taskbar?
Windows hides the icon when it considers the drive “safe to remove” automatically (Quick removal policy) or when the icon area is crowded. You can always use the hidden Safely Remove Hardware dialog (RunDll32 command) or Device Manager to eject manually.
Can I eject a USB drive from the command line?
There is no built-in command to eject a USB drive in Windows 11. Third-party tools like “EjectUSB” or PowerShell scripts can do it, but they rely on the same underlying API and will fail if a process holds a lock. The graphical methods are more reliable.
Does a USB hub cause ejection problems?
Yes, sometimes. A hub with its own power management may put the drive to sleep, and Windows may lose track of the device. Try connecting the drive directly to a motherboard USB port (not a hub or front-panel port) to rule out power or driver issues.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Windows 11 Search: Customize & Use It Fully
- Create Administrator Account in Windows 10: 5 Ways
- Browser Automation Scripts: Step-by-Step Guide
- Fix Camera App Error 0x200f4246 0x80040154
- Android Alerts on Windows 10: How to Get Them
- PL2303 Driver Windows 11 Install Guide