How to Remove Unused COM Ports in Windows

Every time you attach a communication device that uses a virtual COM port in Windows, it assigns a new COM port for it. For example, when you attach the 3G USB dongle in your Windows PC, it creates a new COM port for using it as a modem. Similarly, more COM ports are created for new devices. Soon enough your computers starts to have ports like COM 20 and COM 21. But some of the legacy software may not work ports with such high numbers. For them, you need COM 2 or COM 3 which are occupied by some other unused device. In order to free up these ports of lower numbers, you will have to uninstall the unused COM ports in Windows.

Here is how you can uninstall unused COM ports in Windows:

  1. Since the devices that used the now-unused COM ports are no longer available, you will have to launch the Device Manager in such a way that it can display even the unused devices. For this, open the elevated command prompt and give the following commands:
    set devmgr_show_nonpresent_devices=1
    devmgmt.msc

    Remove Unused COM Ports

  2. In the Device Manager window, select View → Show hidden devices from the toolbar to display all the hidden devices.Remove Unused COM Ports
  3. Expand the Ports (COM & LPT) section to see all the COM port numbers assigned in your PC. Select the one that you are not going to use in future, right-click on it and choose Uninstall from the context-menu.Remove Unused COM Ports
  4. You will be asked a confirmation about uninstalling the COM port. An option to delete the driver files also may appear, in which case choose NOT to delete the driver software as you may want to use this device later on.Remove Unused COM Ports
  5. Click OK and proceed to uninstall the device. A system reboot might be required before you can finally re-assign the freed up port number for some other device.

Conclusion: You can free up all the COM ports assigned to devices that are no longer available to your Windows PC. This way you can re-use these ports for some other devices that might require a particular COM port for working properly.