In this tutorial we will show how to change, reset, and free up COM ports in Windows using Device Manager, CMD, Process Explorer, and registry tweaks.
Understanding COM Ports in Windows
Note that Windows assigns COM port numbers based on the COM Name Arbiter (ComDB) and device-specific registry mappings. In many cases, previously connected devices will reuse their last assigned COM port number. New devices are assigned an available COM port based on the current reservation table (but the assignment is not strictly sequential).
There are 2 different โCOM port in useโ scenarios in Windows:
- Reserved COM port (it is stored in the system (ComDB), and not actively used)
- Active COM port usage (the port is currently opened by a running process)
These scenarios require different troubleshooting approaches.
In case the COM port is only reserved (ComDB), you can free it using Device Manager or ComDB cleanup methods described below.
Some legacy apps can only use low COM port numbers from 1 to 9. In order for such an application and device to work properly, you should change the assigned COM port number or completely release the reserved COM ports used by other app.
Note that a COM port being โfreeโ in Device Manager does not always mean it is available for assignment (in case it remains reserved in the COM Name Arbiter database).
Physical vs Virtual COM Ports
Virtual COM ports are still widely used in Windows, although modern computers almost never have physical serial COM ports on the motherboard. For example, virtual COM ports are currently used by USB (USB-to-UART, USB-to-COM, USB modem, card/RFID reader) and Bluetooth adapters.
How to Change the COM Port Number in Windows
The administrator can manually change the assigned COM port number for the device using the Device Manager.
Using Device Manager to Reassign a COM Port
- Open the Device Manager (press Win + R and run devmgmt.msc)
- Expand Ports (COM & LPT);
- Find the device you want to change the COM port number for and open its Properties;

- Go to the Port Settings tab and click the Advanced button;

- Select a free COM port number from the COM Port Number drop-down list.

Fixing the โCOM Port Already in Useโ Error
These steps won’t help if Windows says you that the COM port you need is already in use. In this case, try to manually reset the used COM port and then reassign it to a new device.
Reset COM Port in Use on Windows
Important. Note that this method only removes device instances from Device Manager. It does not guarantee permanent COM port release, because Windows may reassign the same COM number based on registry history (ComDB).
If the device is not currently connected to the computer, you can reset its assigned COM port number.
Uninstalling Hidden Devices in Device Manager
- Go to Device Manager, select View > Show Hidden Devices from the menu. This will cause the unplugged devices to be displayed in the Device Manager.

- Expand the Ports (COM & LPT) section. Disconnected devices have the reserved COM port number in their names and greyed out icons;
- Right-click on the device with the COM port number you want to free up and select Uninstall;

- DO NOT check the option โDelete the driver software for this deviceโ;
- Repeat these steps until all grayed-out COM ports are removed. Note that removing hidden devices does not clear COM port reservations stored in the COM Name Arbiter (ComDB). You should keep in mind that the same COM port may be reassigned automatically when the device is reconnected.
- Now you can assign a free COM port number to the device you want as described above.
How to Find Which Process is Using the Serial (COM) Port
COM ports are used by devices in Windows in exclusive mode. A COM port cannot be released or deleted if it is being used by another running process. In this case, use the Process Explorer to find out which Windows app is using the COM port.
- Go to the Device Manager, expand Ports (COM & LPT), right-click on the COM port you want to check, and select Properties;
- Go to the Details tab, select Service from the Property dropdown list;
- Copy the service value that your COM port refers to. In this example, this is Serial;

- Download the Process Explorer utility from Microsoft;
- Extract the ProcessExplorer.zip and run the procexp.exe or procexp64.exe (depending on the bitness of your Windows) as an administrator;

- Select the Find > Find Handle or DLL from the top menu (or press Ctrl+F);

- Paste the COM port handle you copied from Device Manager into the Handle or DLL substring search box (serial in this case) and click Search;
- Process Explorer will display the name and PID of the process using the target COM port. Note that in some cases, COM ports used by kernel-mode drivers/system services may not appear as explicit handles in Process Explorer. In such cases, the port is held by a driver rather than a user-mode process.

- Identify the process using the COM port and gracefully close the app that owns it. To do this, use the TaskManager.exe or console. For example, to terminate a user app, run the following command:
taskkill.exe /F /IM putty.exe
- Then you can reassign the COM port number to another device.

Note that you should avoid force-terminating processes unless absolutely necessary. Some COM ports are used by system services/device drivers, so killing such processes may cause device instability, reconnection loops, or data loss.
In case you can’t close the process normally, you can terminate it as a last resort (but only after you have verified that it’s not a critical system component.
How to View Assigned COM Ports Using the Registry
Windows stores the current mapping between serial devices and assigned COM port numbers in the following registry location:
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
To view the assigned COM ports, follow the steps below:
- Open Registry Editor (regedit.exe);
- Go to HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
- . Review the device entries and assigned COM numbers.
Here is an example:
\Device\Serial0 COM1
\Device\Serial1 COM3
This registry key shows currently mapped serial devices. Note that it does not remove COM port reservations. COM number allocation is managed by the COM Name Arbiter (ComDB).
For faster troubleshooting and automation, you can query the same info using PowerShell command:
Get-ItemProperty "HKLM:\HARDWARE\DEVICEMAP\SERIALCOMM"
Checking COM Ports Using PowerShell
You can use PowerShell to quickly inventory installed serial devices and view their assigned COM port numbers without opening Device Manager.
To list installed serial ports and their current status, run the following command:
Get-CimInstance Win32_SerialPort |
Select-Object Name, DeviceID, Status
In order to list Plug and Play COM devices, including their current installation state, use the command below:
Get-PnpDevice -Class Ports
To find disconnected/problematic COM devices:
Get-PnpDevice -Class Ports |
Where-Object Status -ne "OK"
PowerShell can help you to inventory COM devices, but it cannot reliably identify processes holding an open COM handle. For this case you should use Process Explorer/Handle.exe.
Tools for Managing COM Ports
COM Name Arbiter Tool
The free third-party tool COM Name Arbiter can be used to release unused COM ports and change assigned port numbers. Download the COM Name Arbiter Tool from the official website and run as an Administrator.
The tool shows list of COM ports with checkmark next to the currently busy ports of connected devices. Press the Remove non-present devices to clear all assigned COM port number reservations.
You can also clear the COM port manually, by unchecking a specific device from the list.

COM Port Info Utility
Another handy tool for viewing COM port configuration is COM Port Info. This tool allows you:
- View assigned COM port numbers;
- Safely remove hardware;
- Change and swap COM port numbers;
- Reset USB Ports.

Clear and Remove Unused COM Ports
Using CMD and PnPUtil
The built-in PnPUtil tools can be used to list and remove assigned COM port numbers from the command prompt.
Important. Keep in mind that the pnputil /remove-device command removes the device instance from Windows. This may cause automatic driver reinstallation when the device is reconnected and can reset device config/COM port assignments.
List COM port devices:
pnputil /enum-devices /class ports

In this example, the COM3 port is assigned to a MediaTek USB Port device. This device is currently Disconnected.
Keep in mind that pnputil operates at the device instance level and does not directly control COM port number allocation. COM assignment is still managed by the COM Name Arbiter (ComDB) and driver behavior.
Note that this operation does not uninstall the driver package, but removes the device instance from the system. When the device is plugged in again, Windows will re-enumerate it and may assign a new COM port number depending on current availability and registry state.
Copy and paste the Instance ID into the following command to remove this COM device reservation:
pnputil /remove-device "USB\VID_0E8D&PID_0003\5&1082c90b&0&2"
Reset COM Ports Reservation via the Registry Editor
The following low-level method of removing all COM port reservations in Windows requires direct modification of the system registry.
Important. Note that editing ComDB/Ports registry values affects system-wide COM port assignments. After reboot, Windows may re-enumerate USB-to-serial devices, and this can result in changed COM port numbers/driver re-binding.
Windows stores COM port reservations in the ComDB value under the registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter.
The COM Name Arbiter maintains a system-wide bitmap of allocated COM port numbers. Each bit in the ComDB value represents whether a specific COM port (COM1โCOM256) is reserved.
When a COM port is assigned to a device, its corresponding bit in the ComDB bitmap is set. Even in case you will disconnect the device, this reservation may remain until it’s manually cleared. This is why COM ports can appear as โin useโ even when no device is actively connected.
You can make direct changes to the registry to reset COM port reservations.
Caution. Create a system restore point before making these registry changes. In case you modify the ComDB value, it will directly affect all COM port reservations. Incorrect changes may lead to unexpected port reassignment for connected devices.
- Disconnect any peripheral devices from the computer;
- Open the Registry Editor (regedit.exe);
- Go to the reg key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter;
- Right-click on the COM Name Arbiter key, select Export, and backup this registry key to the *.REG file. This allows you to restore previous settings if something goes wrong;

- If you want to reset all the COM port assignments, change the ComDB value to 0. Windows will clear the COM port allocation bitmap. After reboot, all previously assigned COM ports will be considered free, and devices will be re-enumerated as new hardware instances. The binary value of ComDB is a bit-mask of already allocated COM ports. The ComDB value is a bitmap that tracks the allocation status of COM ports COM1 through COM256. This action may cause USB-to-serial devices to rebind to different COM port numbers after reboot. Note that apps that rely on fixed COM port mappings may stop working until you reconfigure them;

- Then go to the reg key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports key. Note that deleting entries under this key removes static COM port mappings. However, dynamic USB devices may recreate these mappings automatically when reconnected;

- Restart your computer. When it boots back, connect all the COM devices in the proper order. After reboot, Windows will rebuild COM port assignments based on device connection order, driver history, and available COM slots. Keep in mind that previously used COM numbers are not guaranteed to be restored.
Now you know how to delete COM ports and reassign them to a different device.
Summary of risks
- COM port numbers may change after reboot
- USB-to-serial devices may be re-enumerated
- Apps relying on fixed COM mappings may break
- Device reinstall/driver re-binding may occur automatically
- Serial apps may fail silently without clear error messages if COM mappings change unexpectedly
What does โCOM port is already in useโ actually mean?
It can refer to two completely different situations:
- Reserved COM port โ the port number is stored in the system (ComDB), but not actively used
- Active COM port usage โ the port is currently opened by an application or driver
These scenarios require different troubleshooting approaches.
Why does Windows keep COM ports reserved after devices are disconnected?
Windows does not automatically release COM port numbers. Instead, it keeps them reserved in the COM Name Arbiter (ComDB) to maintain consistent device-to-port mappings.
How do I check if a COM port is actively used by a process?
Use Process Explorer:
- Search for the port handle (e.g., serial)
- Identify the process using the port
- Close the application if possible
What is COM Name Arbiter (ComDB)?
Itโs a Windows system component that:
- tracks allocated COM port numbers using a bitmap
- prevents port conflicts
- stores historical port assignments
Even disconnected devices may still have reserved ports in ComDB.
Whatโs the difference between changing and resetting a COM port?
- Change โ assign a different port number (Device Manager)
- Reset โ remove old reservations (hidden devices, registry, or pnputil)


