Attempting to safely remove an external hard drive, USB flash drive, or SD card reader in Windows 11 by clicking “Safely Remove Hardware and Eject Media” only to be greeted by the modal error dialogue: “This device is currently in use. Close any programs or windows that might be using the device, and then try again” is a common daily frustration. Unplugging the drive forcefully risks file system corruption, partition table damage, and write-cache data loss. Identifying what holds the lock allows you to detach the drive safely.
Identify the Locking Process via Windows Event Viewer
Windows 11 logs an exact audit entry identifying which application process ID blocked the USB eject request:
- Right-click the Start button and select Event Viewer.
- In the left tree, expand Custom Views > Administrative Events (or expand Windows Logs > System).
- Look for warning events with the Source labelled Kernel-PnP and Event ID 225.
- Click on the Event ID 225 entry. The description box will state: “The application [ProcessName.exe] with process ID [PID] stopped the removal or ejection for the device…”
- Note the process name (e.g.
svchost.exe,explorer.exe,acroread.exe, orSystem). - Open Task Manager, locate that specific process or PID, and terminate it cleanly.
Find and Close Locked Handles Using Resource Monitor
If you don’t want to dig through system logs, Windows Resource Monitor allows you to search for open disk file handles directly:
- Press Windows Key + R, type
resmon, and press Enter. - Switch to the CPU tab at the top.
- In the Associated Handles section, type your USB drive letter followed by a colon into the Search Handles field (for example, type
E:orF:). - Resource Monitor will list every running process accessing files or directories on that drive letter.
- Right-click the offending process in the list and select End Process. Return to the taskbar system tray and eject the drive.
Restart Windows Explorer via Task Manager
Very frequently, Windows Explorer itself holds open handles to the drive because of a thumbnail generation process or folder navigation cache:
- Press Ctrl + Shift + Esc to open Task Manager.
- Under the Processes tab, scroll down to find Windows Explorer.
- Right-click Windows Explorer and select Restart.
- The desktop interface will refresh. Close any open File Explorer windows pointing to the USB drive and attempt to eject it again.
Set Removal Policy to Quick Removal
Windows 11 provides two storage removal policies: “Quick removal” (which disables write caching so drives can be unplugged safely without manual ejection) and “Better performance” (which uses write caching and requires manual ejection):
- Right-click the Start button and select Disk Management.
- Locate your USB drive in the lower graphical disk list (e.g. Disk 1 or Disk 2).
- Right-click the disk header (the grey box on the far left that says Disk X – Removable) and choose Properties.
- Switch to the Policies tab.
- Ensure that Quick removal (default) is selected rather than Better performance.
- Click OK. When Quick Removal is active, Windows guarantees that write buffers are flushed continuously, meaning you can unplug the drive safely as long as no file copy progress bar is actively transferring data.
Safely Take the Disk Offline in Disk Management
If a stubborn system service refuses to release the drive and you must remove it immediately without rebooting:
- In Disk Management, right-click the grey disk header box for your USB drive.
- Select Offline. Windows cuts all software handles and dismounts the filesystem volumes immediately.
- Disconnect the physical USB cable safely. Remember to right-click and choose Online next time you connect the drive.