+1 (213) 22-13-744 (From 9.00 to 18.00 +3GMT). Contacts: 340 S Lemon AVE, Walnut CA 91789

Hetman Software
Safety Has a Name

Code 21: Windows is removing this device

Does the Device Manager show a message like “Code 21: Windows is removing this device”? Do you have difficulties installing a video, sound or network driver for your computer/laptop? Does your mobile phone, video camera, external disk or another USB device connected to a Windows system refuse to work? Are you looking for the meaning of this Device Manger error: “Code 21: Windows is removing this device”? Then read our manual.

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)

Microsoft recommended resolution:

Relevant for such OS as: Windows 10, Windows 8.1, Windows Server 2012, Windows 8, Windows Home Server 2011, Windows 7 (Seven), Windows Small Business Server, Windows Server 2008, Windows Home Server, Windows Vista, Windows XP, Windows 2000, Windows NT.

How to correct an error: "Code 21: Windows is removing this device"?

  1. Restore deleted data;
  2. Enable the device in Device Manager;
  3. Install the default driver suggested by Windows;
  4. Install an alternative driver for the device;
  5. Delete and reinstall the driver;
  6. Install the device with the help of Add Hardware Wizard;
  7. Reconnect the device;
  8. Delete the devices you are not using;
  9. Close all programs which are running;
  10. Restore the last good registry configuration;
  11. Enable the device in BIOS;

Restore Deleted Data

Restore deleted data after error Code 21: Windows is removing this device

Errors that occur in Device Manager can be accompanied with accidental deleting or damaging data. To restore it, use Hetman Partition Recovery.

You can download for free and try the program. Install it and scan a media. All the files found by the program will be restored in the way they look in the preview window.

Learn about the program features and step-by-step guide.

Enable The Device in Device Manager

An error may occur if a new gadget is disabled in Device Manager. To enable it, do as follows:

Enable The Device in Device Manager: Code 21: Windows is removing this device
  1. Review the list of device categories and click on the arrow next to the category of your device. The device may be marked with a yellow triangle.
  2. Right-click on the device name and click Properties.
  3. In the dialogue box Device Properties go to Driver tab and click the button Enable.
  4. Restart Windows if necessary.

Install The Default Driver Suggested by Windows

The error “Code 21: Windows is removing this device” can occur when a driver for your device is not available. To install the driver, follow these steps:

  1. Review the list of device categories and click on the arrow next to the category of your device. The device may be marked with a yellow triangle.
  2. Right-click on the device name and click Properties.
  3. In the dialogue box Device Properties go to Driver tab and click the button Update Driver.
  4. Update the driver using Search automatically for updated driver software.
  5. Restart Windows if necessary.
Install The Default Driver Suggested by Windows: Code 21: Windows is removing this device

Note. If you can’t find the driver automatically Windows will suggest you to specify the path to the necessary device driver. In this case, you should download the latest driver version from the manufacturer’s official website.

Install an Alternative Driver For The Device

An error can occur because of a driver installed incorrectly, so installing alternative software can fix this problem. If your device is working with a default driver, find and download a driver from the official website of your device manufacturer. To install it, do the following:

Install an Alternative Driver For The Device: Code 21: Windows is removing this device
  1. Review the list of device categories and click on the arrow next to the category of your device. The device may be marked with a yellow triangle.
  2. Right-click on the device name and click Properties.
  3. In the dialogue box Device Properties go to Driver tab and click the button Update Driver.
  4. Update the driver using Browse my computer for driver software, then specify the location of the downloaded driver and click Next.
  5. Restart Windows if necessary.

Note. Device software can be provided as an installation file (usually setup.exe). In this case, just launch the file and follow the directions of its installation wizard.

Delete and Reinstall The Driver

The error “Code 21: Windows is removing this device” can occur because of a driver installed incorrectly or if some of its files damaged or deleted. In this case, deleting and reinstalling software will fix the problem. To delete the driver:

  1. Review the list of device categories and click on the arrow next to the category of your device. The device may be marked with a yellow triangle.
  2. Right-click on the device name and click Properties.
  3. In the dialogue box Device Properties go to Driver tab and click the button Uninstall.
  4. Restart your computer.
  5. Then install the default driver suggested by Windows or from the manufacturer’s official website.

Install the device with the help of Add Hardware Wizard

If the driver is installed but your computer cannot recognize the device yet, it can be installed with the help of Add Hardware Wizard. To launch Add Hardware Wizard do the following:

Install the device with the help of Add Hardware Wizard: Code 21: Windows is removing this device
  1. Right-click on the Start button, then on Run menu.
  2. Type in command hdwwiz, then click Enter.

Install the device following the wizard direction and clicking the Next button.

Reconnect The Device

An error can occur when you try to use the device after “Safely Remove Hardware” command. In this case, disconnect the device physically and reconnect it again. Windows is supposed to show you a notice.

Reconnect The Device: Code 21: Windows is removing this device

Delete The Devices You Are Not Using

The error “Code 21: Windows is removing this device” can occur if the registry size limit is exceeded. The problem can result from the registry containing records of many devices that were connected to the computer earlier.

Delete The Devices You Are Not Using: Code 21: Windows is removing this device

So delete the devices you are not using anymore:

  1. Adjust the Device Manager to show the devices which are no longer connected to the computer:
    • Right-click on the Start menu and select Run.
    • In the Open field type in the cmd command to open the Command prompt window.
    • In the command prompt, type in the command Set devmgr_show_nonpresent_devices = 1 and press Enter.
  2. In the Device Manager, select the menu item View / Show hidden devices. Now you can see the devices which are no longer connected to your computer.
  3. Delete the devices you are no longer using:
    • Select the device you need to delete.
    • In the dialogue box of the device properties go to the Driver tab and click Uninstall. Then follow the directions.
    • Restart the computer if necessary.
  4. Now have a look at the dialogue box of the device properties in the Device Manager to see if the error has been fixed.

Close All Running Programs

If your computer lacks memory to start a device, you can free up some memory by closing several of the programs which are running at the moment. To do it, launch the Task Manager by pressing the key combination CTRL + ALT + DELETE or right-clicking on the Start menu and selecting the menu item with the same name.

Close All Running Programs: Code 21: Windows is removing this device

Select the application which you need to close and click on End task. If this method doesn’t help, you may need to add more memory (RAM).

Restore The Last Known Good Registry Configuration

If installation of a device driver blocks booting of the operating system, you can boot the last known good configuration of your system. The function “Last Known Good Configuration” is a recovery method you can use to repair your computer with the last effective parameters. This function restores all data, drivers and registry settings used during the last successful start of your computer/laptop.

Restore The Last Known Good Registry Configuration: Code 21: Windows is removing this device

To start this function press F8 while the system is loading and you will see a classic boot menu. Specify the necessary boot method and this function will be launched.

Enable The Device in BIOS

For any device to work correctly under a Windows OS, it has to be first recognized by BIOS. Usually it happens automatically. If it doesn’t, BIOS should be updated. To do it, download firmware from the official website of your computer/laptop manufacturer and follow the directions on how to adjust it properly.

Note. Updating firmware may result in blocking the system completely, so do it only in case of urgent need. Make sure you have downloaded the latest firmware and it is fully compatible with your hardware. Observe all installation recommendations and create a backup copy of your important data. If you don’t feel confident of what you are going to do, trust this job to professionals.

If the solutions above do not help you, you may need to replace the device.

In other languages:

Other Device Manager errors

Comments

Is the error "Code 21: Windows is removing this device" fixed now? Leave your feedback and ask questions in your comments.