How to Delete COM Ports In Use

In case you are facing with trouble with your COM ports in use that stacking, these brief steps below will help you to clear them out (for example, when you found myself needing to connect via a USB to Serial adapter to a server and noticed that 35 COM ports showed in use). Somehow the COM ports were not getting cleared out.

The fact is that when you connect a new device, Windows creates a new virtual COM port with a value from 1 to 255. When you remove this device, the created COM port will not be deleted automatically. And any new COM port is assigned the first unallocated COM port number.

Some legacy applications do not work correctly with COM ports with numbers 10 and higher. What to do in case your COM device received such a number? This time we will show you how to delete reserved COM ports and remap the COM port for a particular device.

Delete COM Port in Use

Information about the COM ports in use is stored in the CommDB registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter. However, changing the value of this attribute manually is rather risky. It is much easier to clear information about used COM ports using Device Manager or devcon utility.

com ports in use

Step 1: Run Command prompt

One thing is to see if hidden devices are taking up the ports: run Command Prompt (cmd.exe) with the elevated privileges.

Step 2

Type set devmgr_show_nonpresent_devices=1 in the Command Prompt and then press Enter (you might have to restart your computer after this step).

Step 3

Type cd \Windows\system32 in the Command Prompt and then press Enter.

Step 4

Type start devmgmt.msc in the Command Prompt and then press Enter.

Step 5

Check if the hidden devices are connected to PC.

Click View > Show hidden devices. This will display devices that are not connected to your computer.

Step 6: Uninstall COM ports in use

Now if you expand the section on COM ports, all the COM ports that have ever been created will be displayed (the non-present ones being in grey). You can uninstall away anything that you don’t want (right click, select Uninstall).

how to clear com ports in use

Also, you can clean up garbage COM ports by using the DevCon utility that is included to the Windows Driver Kit (WDK), Visual Studio and Windows SDK for desktop apps. Open the Command Prompt and go to the directory with the program:

Cd %WindowsSdkDir%\tools\x64\

List the busy ports with the command:

devcon findall =ports

clear com ports in use

Now you can consistently remove all unused ports using their IDs, for example:

devcon remove @”PCI\VEN_8086&DEV_A13D&SUBSYS_30BE17AA&REV_31\3&11583659&0&B3”

Thus, you can delete all unnecessary COM ports (if you try to remove the used device, the Remove failed error appears).

remove com ports in use

COM port reassignment

If you need to reassign the COM port for a specific device:

  1. Open the Device Manager;
  2. In the Ports section, open the Properties of the device to which you want to reassign the COM port;
  3. Click the Port Settings tab, and then click the Advanced button;
  4. In the Com Port Number drop-down list, select the desired number and press OK.

windows 10 com ports in use

You may also like:

How to stop Windows 10 from automatically changing... If you are annoyed at the fact that your printer is shared and changing all the time, then there is a little option for that. Microsoft changed the au...