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 COM or an USB device (such as smartphone, modem, RS232 to USB converters etc.), Windows detects newly connected device using Plug-and-Play (PnP) and creates a new virtual COM port with a number from 1 to 255. When you remove this device, the created COM port will not be deleted automatically. If you reconnect this device to a computer, the system re-assigned to it the reserved COM port number. But for any new COM device is assigned the first unallocated (free) COM port number. Thus, over time, a large number of reserved COM ports (in “in use” state) for certain COM or USB devices may appear in the system, although the devices themselves may not be connected to your computer. These ports by-default are not visible to the user in Device Manager.

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 registry parameter CommDB under the registry key 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, devcon CLI utility or COM Name Arbiter Setter tool.

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 c:\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

Activate the display of hidden devices from top menu by clicking View > Show hidden devices. This will list all devices including those that are not connected to your computer.

Step 6: Uninstall COM ports in use

Now if you expand the Ports (Com&LPT) section, all the COM ports that have ever been created will be displayed (the hidden and unused 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

This way you can delete all unused and hidden COM ports. Be careful and do not accidentally delete COM ports that work fine.

You can view a full list of assigned COM ports without Device Manager with the help of Command prompt commands:

mode

or

wmic path Win32_SerialPort

or PowerShell cmdlet Get-WMIObject:

Get-WMIObject Win32_SerialPort | Select-Object Name,DeviceID,Description

COM ports in use powershell

Using DevCon to Delete Unused COM Ports

Also, you can clean up unused COM ports with the help of 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 reserved COM 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&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 Name Arbiter Setter Tool

Also you can easily remove unused COM-Ports with the help of graphical tool – COM Name Arbiter Setter V0.7 (you can download it here). This utility could help you to modify registry parameter ComDB in a simple way.

Download and extract the archive com_name_arbiter_setter.zip. Run COM_Name_Arbiter_Setter.exe with administrator permissions to allow access to system registry.

delete COM ports in use arbiter tool

You can see on screenshot that only COM1 and COM3 ports are reserved.

You can delete all COM port reservations by clicking Clear non present button, or by unchecking all unused COM ports. Click apply to save changes and clear com ports assignment.

COM Port Re-assignment

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

Comments
  1. Posted by Jay Sheldon
  2. Posted by Brian Jackson
  3. Posted by Charlie Chau
  4. Posted by John Chase
  5. Posted by Patrick O'Keeffe
    • Posted by Brian Jackson
  6. Posted by victor
  7. Posted by chris
  8. Posted by mike
  9. Posted by stype
  10. Posted by Bob
  11. Posted by Alfred Theorin
  12. Posted by Shiddhartha Nandy
  13. Posted by Muhammad Nadeem Sarwar
  14. Posted by Bryan
  15. Posted by Joost
  16. Posted by serestma
  17. Posted by TammyJo Sessamen
    • Posted by Brian Jackson
  18. Posted by Dale
  19. Posted by Frank Nash
  20. Posted by Tim Detwiler
  21. Posted by curt

Add Your Comment