All hardware in a Windows PC is registered as a hardware device. Windows uses device drivers to communicate with these hardware devices. New drivers are added when new hardware is detected. New drivers can be installed automatically if device support is included with Windows. If not, drivers need to be installed manually. But what happens if you remove a hardware device or no longer use a device? Do you need to uninstall devices in Windows, or does that happen automatically?
For onboard hardware, like a CPU, bus controllers, and similar hardware, it is simple. The hardware is present in the system, so the device and driver need to be configured in Windows. But for external hardware (printers, scanners, mobile phones, and others) this is not straightforward. A lot of external devices are connected through USB, Bluetooth, or Wi-Fi. There is no automatic way to know if these devices are still being used.
Steps to uninstall devices in Windows
When a device is either present in a PC or connected to the PC, the device will show up in the Device Manager. To uninstall the device the Device Manager can be used. Right-clicking a device in the Device Manager will show a popup menu with the option to uninstall it. When selected, you can also confirm whether the driver software should be removed.
But what if the device is no longer present in the PC? Or the hardware is not connected and not available anymore? In that case, the device will not show up in the Windows Device Manager. But the device configuration and driver still exist on the system.
To remove a device from Windows when the hardware is no longer present, we first need to tell Windows to show these non-present devices in the Device Manager.
Note: These instructions apply to all Windows versions. Variations in the text on buttons, confirmations, and popup menus can be present.
- Press the Windows + R keys to show the Run dialog.
- Type cmd, click the Run button, or press Enter to open a Command Prompt window.
- In the Command Prompt window, type set devmgr_show_nonpresent_devices=1 and press Enter.
What this does is set an environment variable in Windows that is used by the Device Manager to show the non-present devices.
Tip: Type set and press Enter to see all environment variables. This allows you to check that the value was set properly. - Close the Command Prompt window by typing exit and pressing Enter.
Note: For Windows 7 and earlier, skip this step, as Windows clears the devmgr_show_nonpresent_devices flag automatically when the Command Prompt window is closed. - Next, open the Device Manager. Either use the Start menu or type devmgmt.msc in the Run box like in step 1.
- In Device Manager, click the View menu and then click Show hidden devices.
You will now be able to see devices that are not connected to the computer. - Expand the category for the device to uninstall.
Non-present devices will show with a grayed-out icon. - Right-click a non-present device.
- In the popup menu, choose Uninstall device.
- Confirm the removal of the device by clicking the Uninstall button in the Uninstall Device window.
Note: For some devices, the Uninstall Device confirmation window will also show a checkbox to delete the driver software for the device. Select that if the driver for the device is no longer needed. - The Device Manager window will refresh and the uninstalled device will no longer be shown.
- Close the Device Manager window when done.
Why uninstall devices in Windows?
The need to uninstall a device in Windows is not common. In many cases, hardware devices are managed automatically, or only need to be dealt with one time during installation.
But there are two cases where uninstalling a device is required.
Reset the hardware device
If a device is showing an error or is not functioning properly, it can often be a problem with the device configuration or the driver software. Using the steps to uninstall a device in Windows, the device configuration is reset and the driver can also be reloaded (with the driver software uninstall option). Many device-related errors can be solved this way, so knowing how to uninstall a device in Windows can be very useful.
Solve error code 49
Error case 49 in the device manager means that Windows cannot start a new hardware device. This is a specific error that can occur when a new device is added and needs to be configured. All device configuration is stored in the Windows Registry. And since device information is critical for Windows to operate, the configuration details are stored in the System Hive. This is the core part of the Windows Registry that is kept in memory for quick access.
If the System Hive grows too large, it will exceed the size limit. That will then result in error code 49 if a device is attempted to be started. This error happens more on older Windows versions, simply because resource limits and size limits for the registry storage space could be a problem.
If a device shows a code 49 error, the solution is often to remove all non-present devices to free up space in the System Hive. If that does not solve the problem, try cleaning up the registry to free up more space.