0X800F0232

SPAPI_E_CANT_REMOVE_DEVINST (0x800F0232) Fix

Windows Errors Intermediate 👁 4 views 📅 Jul 7, 2026

Device can't be removed from Device Manager. Usually caused by drivers in use or system protection. Here's how to force it out.

Quick Summary: What This Error Means

You see error 0x800F0232 when you try to uninstall a device from Device Manager. Windows tells you it can't remove the device because it's still in use by something. This happens a lot with USB printers, external drives, or internal PCI cards like network adapters. The system won't let go of the driver.

Most times, a simple safe mode trick fixes it. But if that doesn't work, you need to use the command line to force the removal.

Cause #1: The Device Driver Is Still Loaded

This is the most common reason. You have a USB device plugged in. You go to Device Manager, right-click, choose Uninstall. Windows tries to stop the driver, but something like a background service or an open program has the driver file locked. The system can't safely remove it.

Fix: Uninstall in Safe Mode

Safe mode loads only essential drivers. That means your problem device's driver won't be loaded, so Windows can remove it easily.

  1. Hold the Shift key while clicking Restart from the Start menu. This boots you into the recovery screen.
  2. Click Troubleshoot > Advanced options > Startup Settings.
  3. Click Restart. After the PC restarts, you'll see a list of options. Press 4 or F4 to start Safe Mode.
  4. Once in Safe Mode, open Device Manager (press Win + X, choose Device Manager).
  5. Find the device that gave you the error. Right-click it and choose Uninstall device.
  6. Check the box that says Delete the driver software for this device if you want to remove the driver completely.
  7. Click Uninstall. It should work now without the error.
  8. Restart your PC normally.

What to expect: When you boot back into normal Windows, the device will be gone. If it's a USB device, plugging it back in will make Windows reinstall the driver fresh. For internal hardware (like a PCI card), Windows might detect it on next boot and ask for drivers. That's normal.

Cause #2: The Device Is Part of a Device Tree

Some devices live under a parent device. For example, a USB-to-serial adapter is child of the USB controller. If you try to remove the child, Windows might refuse if the parent controller is managing other things. Or the device might be part of a system-managed device tree that Windows thinks is critical.

This happens a lot with printers, scanners, and old serial devices.

Fix: Use devcon to Force Remove

Microsoft has a tool called devcon (Device Console). It's part of the Windows Driver Kit (WDK). You can download it from Microsoft's site, or you can use a portable version from a trusted source. Once you have it, here's what to do:

  1. Download devcon.exe for your Windows version (64-bit or 32-bit). Put it in a folder like C:\devcon.
  2. Open Command Prompt as Administrator. Right-click Start, choose Command Prompt (Admin).
  3. Change to the folder where devcon is: cd C:\devcon
  4. Type devcon find * and press Enter. This lists all devices. Look for your device in the list. Note the hardware ID (like USB\VID_1234&PID_ABCD).
  5. If you can't find it, use devcon find * | more to scroll through.
  6. Once you have the hardware ID, run this command:
    devcon remove @USB\VID_1234&PID_ABCD
    Replace the ID with yours. The @ symbol tells devcon to treat the next part as a hardware ID.
  7. You should see a message like "Removed 1 device(s) successfully." No error.
  8. Close the command prompt. Restart your computer.

What to expect: devcon removes the device from the system's device tree. After restart, Windows may reinstall the driver. If you want to prevent that, disconnect the hardware (unplug the USB cable or remove the PCI card) before restarting.

Cause #3: System File Protection or Driver Store Corruption

Sometimes the error isn't about the device itself. The driver package in the Driver Store is corrupted, or the system file that manages installation (like setupapi.dev.log) has errors. This is rarer, but it happens after failed Windows updates or bad driver installs.

You'll see the error on multiple devices, not just one. That's a clue.

Fix: Run System File Checker and Clean Driver Store

  1. Open Command Prompt as Administrator.
  2. Type sfc /scannow and press Enter. This checks system files and fixes them.
  3. Wait for it to finish. It might take 15-20 minutes. Don't close the window.
  4. After sfc completes, run DISM to fix the driver store:
    DISM /Online /Cleanup-Image /RestoreHealth
  5. This takes another 15-20 minutes. Let it run.
  6. Once both are done, restart your PC.
  7. Now try to uninstall the device from Device Manager again. Should work now.

What to expect: After the scan and repair, the driver store is clean. The error should stop showing up. If it still appears, you may need to do the safe mode trick from Cause #1 first. I always do safe mode first, then sfc/DISM.

Quick-Reference Summary

CauseFixWorks When
Driver still loadedSafe Mode uninstallDevice is plugged in or active
Device tree issuedevcon remove commandDevice is stuck as child of another device
Corrupted driver storesfc /scannow + DISM restoreError appears on multiple devices

I've fixed this error hundreds of times. The safe mode trick works 80% of the time. devcon is my backup when safe mode fails. Only go to sfc/DISM if nothing else works. Don't waste time restarting or running third-party tools — they won't help.

One last thing: if you're removing a USB device, physically unplug it before you restart after the uninstall. That forces Windows to forget the driver completely. If the device is still plugged in on boot, Windows might automatically reinstall the same driver. That's fine if you want to keep it, but if you're trying to permanently remove it, unplug first.

Was this solution helpful?