sodcalculator

10 Tech How-To

Fix Windows is Unable to Stop the Device Error

Guide 10-21303 · Updated · Step by step

The “Windows is unable to stop the device” error appears when you try to eject a USB drive, external hard drive, or memory card, and Windows refuses to release it because a program or background process is still using it. The fix is to close the offending program or force-stop the process that holds the device open, then eject safely again. Below are the exact steps to identify and resolve the issue, plus why it happens and how to avoid it.

Why Windows Blocks the Eject

Windows locks a removable device when any file, folder, or application has an open handle to it. This is a safety measure to prevent data corruption from disconnecting mid-write. Common culprits include:

  • File Explorer windows showing the drive’s contents
  • Antivirus or backup software scanning the drive
  • Media players or photo editors with files open
  • Command prompt or PowerShell sessions in that drive’s directory
  • Indexing services or thumbnail generators

The error message names the device but rarely tells you which program is using it, so you have to find it yourself.

Quick Fixes to Try First

Start with the simplest solutions, as they resolve most cases:

  1. Close all open windows, especially File Explorer and any app that might be reading the drive.
  2. Open Task Manager (Ctrl+Shift+Esc) and end tasks for programs you suspect, like media players or backup tools.
  3. Run the Windows “Safely Remove Hardware” tool from the system tray instead of just unplugging.
  4. Log off and log back on, or restart Windows—this releases all handles.
  5. If the drive is connected via a hub, try plugging it directly into the computer.

If the error persists, the next step is to find the exact process using the device.

Find the Process Using the Device

Windows doesn’t show which process holds a device, but you can find it with the built-in Resource Monitor or a free tool like Handle (from Sysinternals).

Using Resource Monitor:

  1. Press Win+R, type resmon, and press Enter.
  2. Go to the CPU tab.
  3. In the Associated Handles section, type the drive letter (e.g., E:) in the search box.
  4. Look for any process listed—that’s what’s using the drive.

Using Handle (command line):

  1. Download Handle from the Microsoft Sysinternals website.
  2. Open an elevated Command Prompt (Run as administrator).
  3. Run handle.exe E: (replace E: with your drive letter).
  4. Note the process name and PID.

Once you know the process, close it normally if possible, or end it in Task Manager if it’s stuck.

Force-Stop the Process Safely

If you can’t close the program normally, you can force it to stop. Be careful—only end processes you recognize; ending a system process can cause problems.

  1. Open Task Manager (Ctrl+Shift+Esc).
  2. Go to the Details tab.
  3. Find the process by name or PID from the Handle search.
  4. Right-click it and select End task.

If the process is a system service, you may need to stop it via the Services console (Win+R, services.msc). For example, if Windows Search is indexing the drive, you can temporarily stop the “Windows Search” service.

After ending the process, try ejecting again. If it still fails, restart Windows—that always releases all handles.

Prevent the Error from Happening Again

Once you’ve ejected successfully, adopt habits that reduce the chance of recurrence:

  • Always use “Safely Remove Hardware” before unplugging.
  • Close all programs that might access the drive before ejecting.
  • Disable indexing on removable drives: right-click the drive in File Explorer > Properties > uncheck “Allow files on this drive to have contents indexed.”
  • If you use backup software, set it to exclude removable drives or pause it before ejecting.
  • For USB flash drives, you can set the policy to “Quick removal” in Device Manager, which disables write caching and lets you unplug without ejecting (but still eject to be safe).

When the Error Persists: Advanced Steps

If the error continues even after restarting, the device itself may have a problem:

  • Run chkdsk E: /f in an elevated Command Prompt to check for file system errors.
  • Update the USB controller drivers in Device Manager (under “Universal Serial Bus controllers”).
  • Try the drive on another computer—if it ejects fine there, the issue is your system, not the drive.
  • If the drive is an external HDD, check its health with the manufacturer’s diagnostic tool.

In rare cases, the error is caused by a Windows bug. Installing the latest Windows updates or running the Hardware and Devices troubleshooter (Settings > System > Troubleshoot > Other troubleshooters) can help.

Frequently Asked Questions

Why does Windows say the device is still in use when I’ve closed everything?
Some background processes, like antivirus scans or indexing, may still be accessing the drive even if you don’t see an open window. Use Resource Monitor to find them.

Is it safe to just unplug the drive without ejecting?
It’s risky. If data is being written, you can corrupt files or the drive’s file system. Always eject properly, or set the drive to “Quick removal” to reduce risk.

Can I disable write caching to avoid this error?
Yes. In Device Manager, right-click the drive > Properties > Policies, and select “Quick removal.” This disables write caching, so Windows doesn’t hold the device as long, but it can slow large transfers.

What if the process using the drive is a system process like svchost.exe?
Don’t force-end system processes. Instead, try restarting Windows, or use the Services console to stop the service that’s accessing the drive (like Windows Search).

Why does this happen more with external hard drives than flash drives?
External HDDs often have write caching enabled by default, which makes Windows hold the device longer. Flash drives may also have it, but they’re often set to quick removal.

Does this error mean my drive is damaged?
Not usually. It’s a software lock, not a hardware failure. But if it happens frequently, run chkdsk and check the drive’s health.

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

The whole Tech How-To bed →