• About the Authors

How to Delete COM Port In Use?

Every time you plug in a COM or USB device to your computer, Windows creates a virtual COM port and assigns it to a device. A new COM port with a unique number from 1 to 255 is created for each connected device (COM1, COM2, COM3, etc). Even if you unplug (turn off) the external device from your computer, the COM port number assigned to it remains reserved (Windows shows it as “in use”). This may exhaust free virtual COM ports on the computer.

In this article, we will show you how to delete COM ports in use or change assigned COM port numbers on Windows.

Note . Although modern computers almost never have physical serial COM ports (such as RS-232), virtual COM ports are still commonly used in Windows for emulated ports created by USB (USB-to-UART, USB-to-COM, USB modem, card/RFID reader) and Bluetooth adapters.

How to Manually Change COM Port in Windows

Some legacy apps can only address COM port numbers 1 to 9. If your device is assigned a high COM port number, you can change it manually using Device Manager.

For example, Windows has reserved the COM24 port for your device, but you need the COM9 port number.

how to clear com ports

  • Expand Ports ;

com ports in use

  • A warning may appear stating that the selected COM port number is already in use. You can ignore this warning by selecting “Yes” and this should not cause any issues.

These steps won’t help if Windows says the COM Port you need is already in use. In this case, manually delete the used COM port and reassign it to a new device.

Delete COM Ports in Use on Windows

You can clear the COM port reservation for a device that is not connected to the computer.

clear com ports

  • Expand the Ports (COM & LPT) section. The COM port number reserved for each device is shown. Disconnected devices have grayed-out icons;

release com port

  • DO NOT check the option “Delete the driver software for this device”;
  • Repeat these steps until all grayed-out COM ports are removed;
  • You can now assign a free COM port number to the device you need.

How to Check Which Program Uses the Serial (COM) Port

In some cases, to free up a serial port (COM port), you will need to find out which application is using the port.

You can use the Process Explorer tool to check which particular Windows process is using the COM port.

  • Open 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 ;

com port in use by another application

  • Download the Sysinternals Process Explorer utility from the Microsoft website;

how to clear com port in use

  • In the Handle or DLL substring search box, enter the name of the service that uses your COM port. In our example, this is serial . Click Search;

remove unused com ports windows 10

  • You have unlocked the COM port and can assign it to your device.

Clear COM Ports Using the COM Name Arbiter Tool

Also, you can easily delete COM ports using the free third-party tool called COM Name Arbiter .

Download the COM Name Arbiter Tool from the official website and run the executable file with Administrator privileges.

Tool shows the 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.

windows com port in use

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.

how to remove com port in use

Removing Unused COM Ports via CMD

You can use the built-in PnPUtil tools to list and remove assigned COM ports from the command prompt.

List COM port devices:

com port used by another application

In this example, you can see that the COM3 port is occupied by a MediaTek USB Port device. This device is currently not connected (Status: Disconnected).

Copy the Instance ID and remove this COM device with the command:

Reset COM Ports Using the Registry Editor

Now let us talk about the most difficult low-level method of deleting used COM ports in Window.

Windows stores COM ports assignments in the registry value of the ComDB parameter under reg key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter. You can make direct changes to the registry to reset COM port reservations.

Caution . It is recommended that you create a system restore point before making these registry changes.
  • Disconnect any peripheral devices from the computer;

close com port

  • Go to the reg key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter ;

how to release com ports in windows 10

  • Restart your computer. When it boots back, connect all the COM devices in the proper order.

Now you know how to delete COM ports and reassign them to a different device.

Our newsletter is full of great content!

Subscribe TheITBros.com newsletter to get the latest content via email.

' src=

Brian Jackson

Brian Jackson started this blog in 2011. Brian has a huge passion for WordPress and technology for over a decade. Brian enjoys blogging, movies, and hiking.

How to Allow Saved Credentials for RDP Connection?

Icacls: list and manage folder and file permissions on windows, leave a comment cancel reply.

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed .

  Windows OS Hub / Windows 10 / How to Clean Up or Reset COM Port Numbers in Windows

How to Clean Up or Reset COM Port Numbers in Windows

A number of legacy applications are able to address only two-digit COM port numbers, and won’t work with COM100 and higher. In the worst cases, these programs work only with COM1-COM9 ports. What if a device has got a higher COM port number?  Is it possible to reset the numbering for reserved COM ports and delete assigned ports?

How to Change a COM Port Number for a Device in Windows?

Find out which process is using a serial com port in windows, resetting com port numbers in windows registry.

In Windows, you can manually change the COM port number assigned to a device. Suppose the necessary COM port is already busy, and you want to try to free it.

  • Open the Device Manager by running the devmgmt.msc command;

Show Hidden Devices

  • Then expand Ports (COM & LPT) and find your device in the list;
  • Go to the Port Settings tab and click the Advanced button;
  • The current COM port number assigned to the device can be found in the COM Port Number field;

Change COM port assigment

But more often you cannot change the assigned COM port number to another one in the hardware properties, since all the “lower” COM ports are already in use.In this case, you need to try to remove the COM port reservation

  • Expand the Ports (COM & LPT) branch, find which COM port number you need is assigned to (a pale icon means that this COM port is assigned, but this device is not currently connected);

Uninstall COM device

Get-WMIObject Win32_SerialPort | Select-Object Name,DeviceID,Description You can get the COM port number for a specific device by its name, for example:

Get-WMIObject Win32_SerialPort | Where-Object { $_.Name -like "*Arduino*"}|select name, deviceid or Get-WMIObject Win32_SerialPort | Where-Object { $_.Name -like "*GPS*"}|select name, deviceid

You won’t be able to release the COM port of a device that is used by Windows or a running program (process). First, you need to stop the process that is currently using the COM port. You can use the Process Explorer tool (by Sysinternals) to find out the name of the process using a particular COM port number ( https://docs.microsoft.com/en-gb/sysinternals/downloads/process-explorer ).

First, you need to display the name of the service that uses the COM port. Run the PowerShell command:

get-pnpdevice -class Ports -ea 0| Select Name, PNPDeviceID, Status, Service

powershell - get com port service name

The service name of the specific COM port is shown in the Service column. For example, for COM2 it is Serial . Now you need to run Process Explorer as an administrator and select Find -> Find Handle or DLL from the menu. In the Handle or DLL substring line, enter the Service value obtained earlier. In our example, this is Serial .

Process Explorer should show the process name that is currently using your COM port. To release the COM port, kill the process or program.

process explorer - getting process name is using serial com port number

Information about the COM ports in use is stored in CommDB registry parameter under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter reg key.

COM Name Arbiter

  • Unplug all external devices and restart your computer;
  • After the reboot, connect the devices in the necessary order, reinstall USB-to-serial converters, etc. All detected COM port devices will be automatically detected by the system and assigned sequential COM port numbers.

You can also use the following free tools to clean up reserved COM ports:

com name arbiter reset tool to reset com port number assignment

  • Device Cleanup Tool – the utility is used to search the registry for previously connected devices (under the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum ), remove unused devices, and clear COM port reservations.

Mailbox Size and Quotas in Exchange 2019/2016 and Microsoft 365

Can’t access shared folders or map network drives from windows 10 and 11, related reading, configure file and folder access auditing on windows..., install any os from iso image over network..., how to add or remove pinned folders to..., how to assign (passthrough) a physical gpu to..., printing from linux to a windows shared printer.

' src=

Hi dear When I open Device Manager there is no branch of (COM & LPT) to expand. How can I Add or Find it?

' src=

thank you so much

' src=

thanks you so much , life saving post 🙂 , i mostly work with iot devices and sometime com ports get busy and am getting com port busy returns in code so this saved my life in flushing com port

' src=

Thank you for the post, very helpful

Leave a Comment Cancel Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Current ye@r *

Leave this field empty

  • Dasduino boards
  • Dasduino kits
  • Black & White e-paper
  • Color e-paper
  • easyC Cables & Adapters
  • easyC Microcontrollers
  • easyC Actuators
  • easyC Sensors
  • Raspberry Pi
  • BBC Micro:bit
  • Breadboard cables
  • Breadboards
  • Power supplies
  • Solar panels
  • Temperature
  • Water & Humidity
  • Voltage & Current
  • Gas & Air quality
  • Movement & Proximity
  • Input devices
  • Stepper & Servo motors
  • Breakout boards
  • Power, Step-up & Step-down
  • Ethernet & Wifi
  • GPRS & GSM & GPS
  • RFID & NFC
  • Lab equipment
  • Screws, nuts & Standoffs
  • Transistors
  • Integrated circuits
  • Connectors & Headers
  • Pushbuttons & Switches
  • Voltage regulators
  • Project boxes

No products in the cart.

WHAT IS COM PORT?

How to reset com ports, how to disable adding new com port numbers, how to clear or reset com ports.

HOW TO CLEAR OR RESET COM PORTS?-Uncategorized

COM port (Communication port) is the name for the port serial interface that can be found in a common computer(IBM compatible). Sometimes computers come with one or two physical COM ports (RS-232), while today’s models don’t have them ususally. However, the COM port does not necessarily refer to physical ports, but also virtual. Such ports are created when using USB-to-UART adapter , most notably used by FTDI and Croduino. Here are a few examples of such devices: USB modems, cell phones, RFID readers , card readers, and so on.

Every time Windows register such a device with a new ID, it gives that device a new COM port (COM2, COM3, COM4, ​​etc.). Even when you turn off the device, the COM port that is assigned to the device remains reserved for it. That is, each time you reconnect they will be assigned to the same COM port. Generally it’s great. The problem can occur if some software that comes into your device is set so that it can access only, say, the first five COM ports. However, this tutorial will describe how to “clean” COM ports that are in use, and how to disable numbering of new ports.

1. Click  Start –   write   regedit  then click Enter. 2. Navigate through folders:  HKEY_LOCAL_MACHINE\SYSTEM\CurrentConstrolSet\Control\COM Name Arbiter

clear com port assignments

Once you confirm the changes by clicking on  OK , our ports are reset. We can also check:

1. Click  Start –   write   devmgmt.msc  or simply  Device manager , then click Enter. 2. From the middle pane, expand  Ports (COM & LPT) , right-click on any of the available ports and  Properties 3. Choose  Port Settings  and click  Advanced 4. Click on the drop down menu  COM Port Number , and we see that all COM ports available.

clear com port assignments

Check those ports after Windows assignes them a COM port, there should be written “ in-use “.

As the title says, follow the instructions to disable the Windows computer from getting the new COM port number each time a new USB-to-UART device is connected.

1. Click  Start –   write   regedit  then click Enter. 2. Navigate through folders:  HKEY_LOCAL_MACHINE\SYSTEM\CurrentConstrolSet\Control\usbflags

clear com port assignments

Products used in this tutorial

No products found

To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.

Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How can I remove all COM ports from the command line on Windows 7?

We have a computer that's used to test some devices. Every once in a while, testers need to go in and remove the assigned COM ports so they free up and start back at 1. Lately, it's been assigning them the same COM port to a couple of devices (around 8 are connected at the same time) and also, they need to change the test code to match whatever number was assigned by the OS.

Duplicate numbers was the reported problem, but I see the 'having to check the COM ports and updating the code' multiple times a day as a problem too.

In Device Manager , if I turn on to show hidden devices, I see hundreds of them!

Enter image description here

You can tell by the size of the scrollbar the list is pretty big. I can click at each one and uninstall, but that's insane going 1 by 1 which is why I ask for a command-line alternative, so I can write a script that they can double click when they need to reset the ports.

Of course, if there's some software out there that will allow for this to happen then that's good too.

  • command-line

Pierre.Vriens's user avatar

2 Answers 2

Remove active USB ports:

Remove active LPT and COM ports:

Query all COM and LPT ports:

Query active USB ports:

Query all USB ports - different results:

Enum all devices:

Part at WDK, Windows Driver Kit Version 7.1.0 .

The old version, 2003-01-29, does not work on Windows 7 (not del device). devcon old version 2003-01-29

Source code for DevCon

Alternative 1 - PnPUtil

Alternative 2 - registry key, search USB device at subkey

Not del all!

If ports enumerate devcon FindAll =Ports - delete this registry key:|

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\ACPI

If ports enumerate devcon status @usb\* - delete this registry key:|

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB

Open registry

Thx geermc4! I tested devcon. On Windows Driver Kit Version it works correctly with Windows 7.

The hardware profile can be set up only for Windows XP. We will not be able to setup on Windows 7. It is by design ... backup HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum ...

Community's user avatar

  • that place you suggested in the registry does look like the place, but devcon seems more straight forward, I do see a long list of devices with devcon, but when i try the remove command i get 'Remove Failed' on all –  geermc4 Commented Feb 7, 2013 at 0:29
  • @geermc4 port enumerate devcon FindAll =Ports or devcon status @usb\* ? –  STTR Commented Feb 7, 2013 at 0:32
  • 2 those did work, just remove failed, I was trying with the old version link since it is a single smaller file to download, but now trying with the new version and that is working yay! –  geermc4 Commented Feb 7, 2013 at 0:43
  • 1 @geermc4 Thx at good comment! Good Luck! –  STTR Commented Feb 7, 2013 at 1:33

I also need to test hundreds of units. However I tried to use command line " devcon /r remove @usb*" and devcon /r remove =ports", which did not work. I also download WDK (donot know how to use it). I felt confused after reading the conversation. @geermc4 and @STTR, would you explain again how you did it?

Albert4913's user avatar

  • This does not really answer the author's question, due to the clarification request, answer should only be used to answer a question. –  Ramhound Commented Feb 8, 2017 at 21:38
  • This is not an answer to the original question. If you have a new question please ask your own question (referencing this one for context if it helps). –  DavidPostill ♦ Commented Feb 9, 2017 at 10:41

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged windows-7 command-line ..

  • Featured on Meta
  • Upcoming sign-up experiments related to tags

Hot Network Questions

  • Homebrew spell to improve familiar link before combat
  • Collaborators write their departments for my (undergraduate) affiliation
  • How to turn a desert into a fertile farmland with engineering?
  • Can I replace a GFCI outlet in a bathroom with an outlet having USB ports?
  • Why can Ethernet NICs bridge to VirtualBox and most Wi-Fi NICs don't?
  • How do I get my D&D group to engage to a minimum
  • Writing a generic makefile for C projects
  • A class for students who want to get better at a subject, aside from their public education
  • Are there substantive differences between the different approaches to "size issues" in category theory?
  • Cancellation of the Deutschlandticket
  • What's the meaning of "nai gar"?
  • What should a content person pray for?
  • Trying to determine what this item is
  • What rights does an employee retain, if any, who does not consent to being monitored on a work IT system?
  • Sarkhan, Soul Aflame Becoming a dragon that entered
  • How does the router know to send packets to a VM on bridge mode?
  • Diagnosing tripped breaker on the dishwasher circuit?
  • Is Good and Evil relative or absolute?
  • "All due respect to jazz." - Does this mean the speaker likes it or dislikes it?
  • Are 1/20 undocumented immigrants married to American citizens?
  • Is FDISK /MBR really undocumented, and why?
  • Is it legal to initialize an array via a functor which takes the array itself as a parameter by reference?
  • Isn't it problematic to look at the data to decide to use a parametric vs. non-parametric test?
  • How do I permanently disable my microphone?

clear com port assignments

Manage COM Port Assignment in Windows 10

This question was asked by Praxair and answered by Brendan3385 but the solution given was product specific and did not solve the issue by modifying Windows 10. That is the type of solution I need.

REF: Windows 10 assign specific COM port to device

I am using digital calipers, Tesa micro heights, and other peripheral measurement devices, running through Midwest flexports with 25 pin serial to USB cables. These run to Dell Optiplex 3070 thin clients into an application called WINSPC.

WINSPC requires specifying the COM port in the application. Windows 10 self manages the assignment of COM ports. It frequently changes this assignment when rebooted or the serial to USB cable is unplugged. When it assigns a different COM port the measurement devices lose the ability to transmit data. I know I can change this manually in device manager every time as an admin but my users can not. I need to stop it from happening.

My ideas are possibly a registry edit, a locally placed startup script, or even a script attached to the profile in active directory.

I will need to frequently solve these types of issues throughout my career so if possible I would rather be taught to fish rather than find one in my desk drawer…

Thanks Everyone!

@lauren7060 @marcmaehner7836 @brendanshreve7169 @pblais

I use a USB Serial Port to access CLI on a Cisco ASA. But, if you open up Device Manager, right-click on device, port settings, advanced. There’s a number of settings, including the COM Port assignment. I quickly tested that assigning to 9, then moving around to different USB slots came up with same COM Port.

As far as Regedit goes, you might check \HKLM\HARDWARE\DEVICEMAP\ - in my case, \SERIALCOMM for the specific setting of COM9 as the example.

Is your thin client connecting to a VM or a RDS Session Host?

This article may be of some assistance. If you can find somewhere to view/update the serial numbers from each device, it should in theory always keep that COM port.

I’m going to look into this on some of our machines here to see if I can replicate this issue.

According to experience before, the Windows assign the COM port according VID, PID and serial number. So with the same device plug in, it should always get same COM port assignment. However, two devices with same VID, PID and serial number might be treated as same device. When you plug in them in sequence, Windows can assign different COM port for them. However, after rebooting the Windows with the two USB devices attached, the COM port assignment should be decided by Windows for the two USB devices with same VID, PID and serial number.

It is connecting to an RDS session.

Der Geist , Thank you, I tried doing what you did by selecting a COM port ( #9 ) that was unlikely to be used by Windows 10. Rather than fight Windows 10 over the COM3 or COM4 slots I sort of harmonized with it by allowing it to have the ability to allocate (manage) the first few (usable) ports as, or if, things get plugged/unplugged and I assigned it to something that should never be used like COM9. After several tests of unplugging rebooting etc… it continues to assign it to COM9

Related Topics

Topic Replies Views Activity
Windows 2 57 March 3, 2016
Windows 5 651 December 14, 2017
Hardware 7 130 July 31, 2014
Hardware 5 142 September 9, 2013
Windows 3 68 March 8, 2016

clear com port assignments

rttycontesting.com

rttycontesting.com

Dedicated to Digital Mode Contesting

Finding & Removing Hidden COM Ports

Finding & Removing Hidden COM ports for Non-connected Devices in Windows XP (this procedure also works for Windows 7 & 10)

Thanks to Jack, KF6T, Rick, N6XI, Ward, N0AX, and Steve, N2IC, as sources for the information on this page.  Since ham radio operators use COM ports to communicate with various devices in their stations, there may be a time when you need to clean out old and unused COM port assignments which were created, but not deleted, by Windows XP.  This may be useful if you have problems installing new COM port devices such as USB Serial Adapters or legacy serial ports.  Or when installing COM devices, Windows assigns higher COM port numbers such as COM18, etc.  In most cases, you can over-ride the port number that Windows assigns by going to the Properties of the device in Device Manager , then to the Port Settings tab and click on the Advanced button.  Or by using one of the two procedures below, you can eliminate old and unused COM ports to free up resources for devices you already have installed and wish to move to a lower port number or for devices you wish to install in the future.

Two procedures are shown below.  The first one is a permanent solution where all hidden devices (including COM ports) will be shown each time  Show Hidden Devices is enabled in the View menu of Device Manager . The second procedure is for showing all hidden devices on a temporary basis and includes how to delete hidden COM ports to free up resources. I’ve performed both procedures on both my shack computers where old assignments of COM ports remained for devices I no longer use.  I am now set for the permanent solution.   Both procedures are outlined by Microsoft at http://support.microsoft.com/kb/315539 .

Procedure for Permanent Fix to Finding Hidden Devices in Device Manager

1. Right click on My Computer then go to Properties .

comport01

9. To delete a particular port, click to highlight it and hit the Delete key on your keyboard.  In the Confirm Device Removal dialog box, click OK .

comport16

10. After you have deleted the unused and hidden COM ports, the list will show only those COM ports you use or may use in the future (during the procedure, you may have to scroll back down Device Manager to get back to the Ports section.) Notice I kept the unused COM6 for my Keyspan USB Serial Adapter even though it is not connected and not being used at the moment.  When I connect my Keyspan adapter, it always comes up COM6 now which is what I want.

comport18

Procedure for Temporarily Finding Hidden Devices in Device Manager

1. COM ports assignments can be viewed from the Windows Device Manager .  There are a couple of ways to get to the Device Manager .  The easiest way, if you have a My Computer icon on your desktop, is to right-click My Computer and go to Properties .  The other way is to go to theStart | Control Panel | System | Hardware | Device Manager.

2. When the Systems Properties dialog window opens, click on the Hardware tab.

comport02

3. On the Hardware tab, click on the Device Manager button.

4. In Device Manager , click the + sign next to Ports (COM & LPT) to reveal what ports are currently in use.

comport04

5. You will notice if you go to the View menu in Device Manager and click on Show hidden devices , that nothing changes in your Ports list.

6. To view actual hidden COM ports, close Device Manager .  Go to Start > Run .

comport07

7. When the Run dialog box opens, type cmd.exe and hit enter or click OK .

comport08

8. When the cmd window opens, type set devmgr_show_nonpresent_devices=1 then hit Enter .

comport29

9. Then open Device Manager from the cmd window by typing start devmgmt.msc and hit Enter . (Note, if Device Manager does not open when you start devmgmt.msc , then type cd\windows\system32 and hit Enter, then type start devmgmt.msc and hit Enter .)

comport30

10. When Device Manager opens, go to the view menu and click Show hidden devices (same as Step #5 above).  Scroll down to the Ports section and you will be able to see all the hidden COM ports.  In this particular example, there are seven hidden COM ports showing on my main shack desktop computer.  Of these seven, six are for devices I no longer use.  I occasionally use the Keyspan port showing as (COM6) so decided to keep it.

11. To delete a particular port, click to highlight it and hit the Delete key on your keyboard.  In the Confirm Device Removal dialog box, click OK .

12. After you have deleted the unused and hidden COM ports, the list will show only those COM ports you use or may use in the future (during the procedure, you may have to scroll back down Device Manager to get back to the Ports section.) Notice I kept the unused COM6 for my Keyspan USB Serial Adapter even though it is not connected and not being used at the moment.  When I connect my Keyspan adapter, it always comes up COM6 now which is what I want.

13. When finished, close Device Manager .  To close the cmd window, type EXIT and hit Enter .  The box will close.

Note that any time you close the cmd window, you lose the context that permits Device Manager to display and manage COM ports for non-connected devices.  To check again, you have to perform the procedure over or else use the permanent fix on the Microsoft webpage listed at the beginning of this page.  On my laptop, I tried to delete unused Bluetooth COM ports that were assigned the same port numbers as my USB serial adapter.  After a reboot, these Bluetooth COM ports returned to the hidden list even though they were not being used.  The only problem it poses is when I disconnect my USB serial adapter and then reconnect it.  Windows may assign different COM ports numbers than what I previously used and have been assigned in my software.  There are 64 COM ports showing on my XP laptop because of Bluetooth.  So far, this hasn’t caused any conflicts that I am aware of.

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

how to assign static COM port number to a device

I have an issue with one device ( Pax Technology Terminal ) connected to Win 10 ( NCR Point of Sale ). after unplugging the device and connecting it the COM port number changes and every time we have to change the port number back to the correct port number for this device to work.

Is there way I set this device to only get a certain COM port number every time they unplug and connect it back ?? something like setting defaults for each device type

Windows 10 A Microsoft operating system that runs on personal computers and tablets. 11,022 questions Sign in to follow

Dear all USB Users, (unsure that this is the right forum for my question...)

Is there a way to programmatically "Recover Unused and FIX COM Numbers" (NI - National Instrument Forum Question...)

It is hard to live with the Totally Random USB COM port Enumeration that Windows always apply... Is there a way to make this less Random, or even totally controlled and pre-visible?

I found that for each USB device the following apply (or at least should apply) Each device has:

  • VID = Vendor ID
  • PID = Product ID
  • PSN = Product Serial Number So with we have the possibility to make a COM-Port-Number Reservation/Binding Option for this USB device with Unique ID: VID&PID&PSN This would result in the possibility for having the desired Unique Fixed COMxx Port Number Reservation...

See my proposal in the attached TXT document... 269324-windows-usb-com-port-enumeration-problem.txt

The Simple Solution to this Problem could be just like **DHCP MAC-Address to IP-Address binding... Like VID&PID&PSN to COMxx Port Binding forever on this computer...

Thanks... The World and I would appreciate a COMMENT to this... And much better also an action to this problem...!

Thank you for reading ana all the best regards Ronn

I encountered similar issue. When the COM number is assignated and confirmed, Device Manager is closed automatically and the COM number remains unaffected.

Windows manages the COM port number assignments, and a device's COM port number may change after a reboot.

To manually change the COM port number of a device:

  • Open Windows Device Manager > right click the device > Properties
  • Under Port tab > Advanced
  • Change COM port number

Also, according to the experience before, the Windows assign the COM port according VID, PID and serial number. So with the same device plug in, it should always get same COM port assignment. But when two devices with same VID, PID and serial number might be treated as same device. When you plug in them in sequence, Windows can assign different COM port for them. However, after rebooting the Windows with the two USB devices attached, the COM port assignment should be decided by Windows for the two USB devices with same VID, PID and serial number.

109773-628.png

-------------------------------------------------------------------------------------

If the Answer is helpful, please click " Accept Answer " and upvote it.

How can ANY two devices have the same serial numbers ??

ECE Labs

GW Electrical and Computer Engineering Laboratories

ECE Labs

Resetting Windows COM Ports

Here are instructions helps ECE 3520 students that are having issues with COM ports using the STK 500.

What is a COM port?

COM port (Communication port) is the name for the port serial interface that can be found in a common computer(IBM compatible). Sometimes computers come with one or two physical COM ports (RS-232), while today's models don't have them ususally. However, the COM port does not necessarily refer to physical ports, but also virtual. Such ports are created when using USB-to-UART adapter, most notably used by FTDI and Croduino. Here are a few examples of such devices: USB modems, cell phones, RFID readers, card readers, and so on.

Every time Windows register such a device with a new ID, it gives that device a new COM port (COM2, COM3, COM4, ​​etc.). Even when you turn off the device, the COM port that is assigned to the device remains reserved for it. That is, each time you reconnect they will be assigned to the same COM port. Generally it's great. The problem can occur if some software that comes into your device is set so that it can access only, say, the first nine COM ports. However, this tutorial will describe how to "clean" COM ports that are in use, and how to disable numbering of new ports.

How reset COM Ports.

Use one of the two methods to reset the COM ports on your Windows computer.

  • Click start –> Run –> type regedit and click OK button.
  • Registry editor will open.
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter
  • In the right panel , you'll see a key ComDB right click to that key and click modify.
  • In value Data section select all and delete reset to Zero ‘0’.
  • Close Registry editor and then restart your computer. All COM ports are now Free. You might need to reinstall any USB to serial convertor.
  • Click go to Start, type devmgmt.msc in the Start Search box, and then press ENTER.
  • In Device Manager, double click Ports (COM & LPT) to expand this section.
  • Right click Communications Port (COM1) and then click Properties.
  • Click Port Settings tab and then click Advanced… button.
  • Pull down COM Port Number list, choose one of the com port in use and then click OK.
  • When a warning message occurs, please ignore it and click Yes directly.
  • Please repeat step 3 to 7 to choose another com port in use. Once the above steps are completed, please change the port back to original (COM1) setting.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

The George Washington University, Washington, DC

  • Campus Advisories
  • EO/Nondiscrimination Policy (PDF)
  • Website Privacy Notice
  • Accessibility
  • Terms of Use

GW is committed to digital accessibility. If you experience a barrier that affects your ability to access content on this page, let us know via the Accessibility Feedback Form .

This site uses cookies to offer you a better browsing experience. Visit GW’s Website Privacy Notice to learn more about how GW uses cookies.

  COM-Port Manager for Windows
 

] [ ] [ ] [ ]

 
 
ComPortMan is a Windows service that gives control over Windows' COM port assignment for COM ports. Running as service makes it independent of the logged on user's privileges, so there is no need to give the users the privilege to change COM ports.
You can define new default COM port numbers by several criteria.
It comes with the tool which shows detailed information about all COM ports.
 
 
 
When a new device which exposes a COM port appears in the system then Windows assigns the first COM port number which has never been used before. So the port numbers get higher and higher with each new device.
You can change the port number assignments in the Windows Device Management with a lot of mouse clicks (and with admin privileges) but you have to do it again for every new device.
And for USB devices that have no serial number you have to do it too when you attach it to a different USB port.

With ComPortMan you can All functions are applied to COM port drives at the moment they are being attached and when the ComPortMan service starts up.

ComPortMan runs as Win32 service under Windows 2000, XP, Server 2003, Vista, Windows 7/8/10/11 and all the Server Editions.

BTW: For cleanup of the port reservations there is my " ".

 
 
 
Either download the distribution ComPortMan.zip file and unzip it to "C:\Program Files" (a ComPortMan folder is included) and start the _service_register.cmd there
Or download the ComPortMan.msi file and right-click -> Install, which installs it silently to "C:\Program Files\ComPortMan" and registers + starts the ComPortMan service.

Then enter your preferred configuration into the ComPortMan.INI (see below). There is a sample file included called ComPortMan_sample.INI. Either create a new ComPortMan.INI or rename the sample.

You can change the ComPortMan.INI without restarting the service because it's checked each time a new COM port device is attached.

You can uninstall the service using parameter -deregister: Both can be done without the message box by using the following ComPortMan commandline parameters

It returns Errorlevel 0 on success, 1 on failure.

You can stop and start the installed service by means of the _service_stop.cmd and _service_start.cmd.

 
 
 
ComPortMan is configured thru a text file, the ComPortMan.INI. The ComPortMan.INI is read from the folder of the ComPortMan.EXE.
If required, read at Wikipedia how work.




Have a look into the help file for more details.
The help file is available too.
If you get the 'cannot display the webpage' error then the help file has the NTFS file attribute 'downloaded from untrusted source' and Microsoft doesn't trust its own CHM file format. To fix this right click the ComPortMan_E.CHM, select Properties and click Unblock.


ComPortMan comes with a GUI application "COM Port Info" which show information about all COM ports. It's also available standalone here:


ComPortMan can show a balloon tip with information about the COM port(s) of a just attached device:

 
 
 
For the complete history check out the help file which is available too.

V1.2.1 (20 May 2024) V1.2.0 (14 April 2024) V1.1.9 (21 Aug 2023) V1.1.8 (21. May 2022) V1.1.7 (13 Nov 2022) V1.1.6 (13 June 2022) V1.1.5 (25 May 2022) V1.1.4 (01 April 2022) V1.1.3 (07 Nov 2021) V1.1.2 (11 July 2021) V1.1.1 (30 May 2021) V1.1.0 (24 May 2021) V1.0.8 (06 April 2021) V1.0.7 (14 Feb 2021) V1.0.6 (08 Feb 2021) V1.0.5 (03 Jan 2021) V1.0.4 (21 Sept 2020) V1.0.3 (21 Sept 2020) V1.0.0 (04 Sept 2020) V0.9.9.0 (26 July 2020) V0.9.8.0 (20 May 2020) V0.9.7.0 (12 Sept 2017) V0.9.6.0 (07 Feb 2017) V0.9.5.0 (10 Dec 2016) V0.9.4.0 (13 July 2015) V0.9.3.0 (17 May 2015) V0.9.2.0 (10 May 2015) V0.9.1.0 (01 Oct 2014) V0.9.0.0 (11 May 2014) V0.8.9.0 (18 Feb 2014) V0.8.8.0 (17 Feb 2014) V0.8.7.0 (15 May 2013) V0.8.6.0 (15 May 2013) V0.8.5.0 (04 July 2012) V0.8.4.0 (03 Juli 2012) V0.8.3.0 (10 June 2012) V0.8.2.0 (1 March 2012) V0.8.1.0 (27 Feb 2012) V0.8.0.0 (27 Feb 2012)

 
 
 

For home users I suggest the ZIP file. Just unzip to "C:\Program Files" and run the _service_register.cmd.
The _edit_ini.cmd opens the ComPortMan.ini file (or creates one). It asks for administrator privileges. Without these the INI file would be redirected to the "Virtual Store" where it is useless.
The MSI is for admins who want to deploy the software in their network. It installs without any feedback to "%ProgramFiles%\ComPortMan". An MSI with integrated ComPortMan.INI is not difficult to create, see ComPortMan help under . There is also some information about using the MSI for ComPortMan updates.

The software is fully functional and does not expire. There is no 'full version'.

Download latest release:
Win32 ZIP:

(about 233 KB)

Win32 MSI - silent install, no message shown

(about 274 KB)

x64 ZIP:

(about 251 KB)

x64 MSI - silent install, no message shown

(about 290 KB)

The anti virus software NOD32 thinks ComPortMan.EXE is "probably a variant of Win32/Genetik". At you can see that all others disagree.

-->

Win32 ZIP Win32 MSI x64 ZIP x64 MSI
V0.1.0.0
 

ComPortMan is Freeware for private and educational (schools, colleges, universities) use only. The students shall outnumber all others.
Otherwise one licence per computer is required after a 30 day test period even though the software does not expire.

To support admins in schools which are often voluntary workers I made ComPortMan freeware for schools, colleges and universities. But that's the line I've drawn and even your organization is non profit, good and important I have to say, it's beyond that line. Ask me for a discount in this case.


(Euro prices are constant, USD prices are floating):

Purchase of: 
1 to 9 licences
10 to 99 licences
100 to 999 licences
1000 to 9999 licences
>10000 licences

Impressum

  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
  • OverflowAI GenAI features for Teams
  • OverflowAPI Train & fine-tune LLMs
  • Labs The future of collective knowledge sharing
  • About the company Visit the blog

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

How to assign a COM port number?

We are using a USB-to-Serial converter. Windows assigns a COM port number to the serial device. For testing purposes, we need to control the COM port number assigned by Windows. For example, we would like to tell Windows to assign COM 255 to a device rather than have Windows decide what the number is. Is there any way to do this?

  • serial-port

Mr. T.'s user avatar

  • 1 Assign it programmatically ? if so, what language ? otherwise, you can do it from Device Manager in Windows. –  Nasreddine Commented Nov 17, 2011 at 15:40
  • 1 This is the most odd test requirement I've seen in awhile... –  Brad Commented Nov 17, 2011 at 15:41
  • 1 It is up to the driver, not Windows. Finding a converter with a driver that lets you do this is going to be hard shopping. The odds that your user will have one are even smaller. –  Hans Passant Commented Nov 17, 2011 at 15:48

3 Answers 3

I do not have to do this programmatically, so Nacereddine is right. My Computer -> Manage -> Device Manager -> Ports -> Communications Port -> Port Settings -> Advanced -> COM Port Number

  • 1 My answer basically said the same thing, but without as much detail because the details depend on the driver. If you are going to accept your own answer which says almost the same thing you should specify the device make/model so that people understand that your answer might be specific to that make/model. –  Shane Wealti Commented Nov 23, 2011 at 0:53

This normally depends on the driver. Some drivers allow you to edit the COM port number assigned by going into the device properties in device manager and using one of the properties pages to specify the COM port number. If the model you are currently using doesn't support this I suggest finding a model that does.

Shane Wealti's user avatar

No, but if you know what device id it reports to the OS then its possible that you could find it programmatically in the device manager.

Here's a link to a code project that may give you some ideas.

ChrisBD's user avatar

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Not the answer you're looking for? Browse other questions tagged windows serial-port or ask your own question .

  • Featured on Meta
  • Upcoming sign-up experiments related to tags
  • The return of Staging Ground to Stack Overflow
  • Policy: Generative AI (e.g., ChatGPT) is banned
  • Should we burninate the [lib] tag?
  • What makes a homepage useful for logged-in users

Hot Network Questions

  • Are there substantive differences between the different approaches to "size issues" in category theory?
  • Word order of 1 Corinthians 1:24
  • Can I replace a GFCI outlet in a bathroom with an outlet having USB ports?
  • How do I get my D&D group to engage to a minimum
  • Would a spaceport on Ceres make sense?
  • Should mail addresses for logins be stored hashed to minimize impact of data loss?
  • Writing a generic makefile for C projects
  • How to turn a desert into a fertile farmland with engineering?
  • Is Good and Evil relative or absolute?
  • Is it madatory to obtain an ethical clearance from my affiliated institute for an interview that is to be presented in a conference?
  • Eye Floaters Optics
  • Familiar senses outside of a turn order
  • Separate unidirectional streams vs single bidirectional stream
  • When was the last time a chess rule was modified?
  • Could Kessler Syndrome be used to control the temperature of the Earth?
  • DSP Puzzle: Advanced Signal Forensics
  • Is it legal to initialize an array via a functor which takes the array itself as a parameter by reference?
  • How does the router know to send packets to a VM on bridge mode?
  • Does "my grades suffered" mean "my grades became worse" or "my grades were bad"?
  • Co-authors with little contribution
  • What US checks and balances prevent the FBI from raiding politicians unfavorable to the federal government?
  • Lines of intersections in a parabola
  • What is the difference between a Blockchain link (Blink) and an Action?
  • Locking for update inside CTEs

clear com port assignments

HOW TO: Remove Unused COM Ports for Re-assignment with Windows RealPort

This guide shows instructions on how to remove and change COM Port Assignments in Windows 7. Because the process requires you to enter the Device Manager, caution is advised .  

Show all Com Port Assignments

  • Open a Command Prompt window, right click and select Run as administrator :

User-added image

  • Type the following lines:

Command prompt

  •  In Device Manager: click View , then Show Hidden Devices .

Show Hidden Devices

  • Expand the section labeled Ports (COM & LPT) to view all COM Ports that have ever been installed on this computer. COM Ports that have been assigned but are not currently connected will have a light-grey icon .

To remove an old COM Port

  • Right-click on the COM Port in question and chose Uninstall.

User-added image

To change COM Port assignments

  • Expand the Multi-port serial adapters entry, right-click on the Digi device you want to change and chose Properties .
  • In the Properties window, click the Advanced tab, followed by Properties .
  • In the Advanced Properties window, click the desired port number on the left, then Serial .
  • Chose an unused COM Port from the drop-down list and click Apply .

User-added image

Recently Viewed

Did you find this article helpful.

Scroll to top of page

Service Name and Transport Protocol Port Number Registry

clear com port assignments

COMMENTS

  1. How to Delete Or Clear COM Ports In Use

    Some legacy apps can only address COM port numbers 1 to 9. If your device is assigned a high COM port number, you can change it manually using Device Manager. For example, Windows has reserved the COM24 port for your device, but you need the COM9 port number. Press Win + R and run devmgmt.msc command; Expand Ports;

  2. How to Clean Up or Reset COM Port Numbers in Windows

    Select View->Show Hidden Devices in the menu; Then expand Ports (COM & LPT) and find your device in the list; Go to the Port Settings tab and click the Advanced button; The current COM port number assigned to the device can be found in the COM Port Number field; To change it, open the drop-down list and select the COM port number you want to set.

  3. How to Clear or Reset Com Ports

    Click Start - write devmgmt.msc or simply Device manager, then click Enter. 2. From the middle pane, expand Ports (COM & LPT), right-click on any of the available ports and Properties. 3. Choose Port Settings and click Advanced. 4. Click on the drop down menu COM Port Number, and we see that all COM ports available.

  4. windows 7

    1) Open Device Manager. 2) From the View menu, select 'Show Hidden Devices'. 3) Expand 'Ports (COM & LPT)' category from the list. 4) Right-click on all the devices and remove them (no need to tick to delete the driver) 5) From the Action menu, select 'Scan for New Devices'. 6) Viola!

  5. How can I remove all COM ports from the command line on Windows 7?

    Remove active LPT and COM ports: devcon /r remove =ports. Query all COM and LPT ports: devcon FindAll =Ports. Query active USB ports: devcon status @usb\*. Query all USB ports - different results: devcon findall @usb\*. devcon findall =USB.

  6. Removing unused COM Ports from Windows

    Show all Com Port Assignments. Open a Command Prompt window and type the following lines: set devmgr_show_nonpresent_devices=1. start devmgmt.msc. *This should automatically open the Device Manager for you. In Device Manager: click View, then Show Hidden Devices. Expand the section labeled Ports (COM & LPT) to view all COM Ports that have ever ...

  7. How do I clear COM ports that are appearing as in use

    Select and click Delete. The trick was to open the Command Prompt as administrator and start the Device Manager from the same command prompt. 1. Right-click "Command Prompt" in Accessories and choose "Run as Administrator". 2. Enter "set devmgr_show_nonpresent_devices=1″ - without the quotes obviously. 3.

  8. Manage COM Port Assignment in Windows 10

    WINSPC requires specifying the COM port in the application. Windows 10 self manages the assignment of COM ports. It frequently changes this assignment when rebooted or the serial to USB cable is unplugged. When it assigns a different COM port the measurement devices lose the ability to transmit data. I know I can change this manually in device ...

  9. Change COM port via registry, command line or software?

    Change the port number: In the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter, you can find the ComDB which is a bit mask of COM ports already allocated. This value should be change based on your COM ports. Note, The first byte controls COM8~1, the second byte controls COM16~9, the third byte controls COM24~COM17 and so on.

  10. How to Reset COM Port Numbers

    1) Right-click on My Computer and select Properties. 2) Select the Hardware tab and open Device Manager. 3) Under 'Ports (COM & LPT)', right click on the COM port and select Properties. 4) Select the Port Settings tab and press the Advanced button. 5) At the bottom, select the desired COM Port Number from the drop down box and press OK.

  11. Finding & Removing Hidden COM Ports

    On the Hardware tab, click on the Device Manager button. 4. In Device Manager, click the + sign next to Ports (COM & LPT) to reveal what ports are currently in use. 5. You will notice if you go to the View menu in Device Manager and click on Show hidden devices, that nothing changes in your Ports list. 6.

  12. How do I delete the unused COM ports in Windows 10?

    Check if you are able to see any hidden devices in the Device Manager. Try these steps to create a new user account and check if it fixes the issue. Refer to the steps below to create a new User Account: Go to Settings. Choose Accounts and then select Other User Accounts towards the left. Select Add an Account.

  13. COM port assignement changes after reboot

    Windows manages the COM port number assignments, and a device's COM port number may change after a reboot. To manually change the COM port number of a device: 1. Open Windows Device Manager > right click the device > Properties . 2. Under Port tab > Advanced . 3. Change COM port number

  14. how to assign static COM port number to a device

    To manually change the COM port number of a device: Open Windows Device Manager > right click the device > Properties. Under Port tab > Advanced. Change COM port number. Also, according to the experience before, the Windows assign the COM port according VID, PID and serial number. So with the same device plug in, it should always get same COM ...

  15. PDF How to Clear COM Port List

    How to Clear COM Port List — When COM port number reaches 256 Log in your PC as administrator. From START menu, right click "Command ... usa Serial Port (COM182) usa Serial Port (COM183) usa Serial Port (COM184) Author: Engineering Created Date: 1/31/2019 3:32:54 PM ...

  16. re-set COM ports

    Click start -> Run -> type regedit and click OK button. This will open a Registry editor. Now right panel , you can see a key ComDB right click to that key and click modify. In value Data section select all and delete reset to Zero '0'. click OK. Close Registry editor and then restart your computer. all COM ports are now Free, you may ...

  17. Resetting Windows COM Ports

    In Device Manager, double click Ports (COM & LPT) to expand this section. Right click Communications Port (COM1) and then click Properties. Click Port Settings tab and then click Advanced… button. Pull down COM Port Number list, choose one of the com port in use and then click OK. When a warning message occurs, please ignore it and click Yes ...

  18. COM-Port Manager

    Or download the ComPortMan.msi file and right-click -> Install, which installs it silently to "C:\Program Files\ComPortMan" and registers + starts the ComPortMan service. Then enter your preferred configuration into the ComPortMan.INI (see below). There is a sample file included called ComPortMan_sample.INI.

  19. Minimal Clear-Com Port Requirements

    Minimal Clear-Com Port Requirements. The information on this page is owned by Clear-Com and constitutes Clear-Com's confidential and proprietary information, may be used solely for purposes related to the furtherance of Clear-Com' business and shall not be disclosed, distributed, copied or disseminated without Clear-Com's prior written ...

  20. windows

    My Computer -> Manage -> Device Manager -> Ports -> Communications Port -> Port Settings -> Advanced -> COM Port Number. answered Nov 17, 2011 at 20:45. Mr. T. 1,345 4 14 24. 1. My answer basically said the same thing, but without as much detail because the details depend on the driver.

  21. How do I delete the unused COM ports in Windows 7?

    Select Properties not Server Properties. Click on Ports Tab. Do you See COM listings? Select and click Delete. The trick was to open the Command Prompt as administrator and start the Device Manager from the same command prompt. 1. Right-click "Command Prompt" in Accessories and choose "Run as Administrator". 2.

  22. Assignments

    Assignments . Network transmission controls/transport settings are in this page (LQ only). This is where you will assign ports to Channels. All devices, with their associated ports appear in the left margin of this page. In the center are three tabs; chose from All, Channels and Directs. Channels (up to 24 in total per Link-Group) are shown on ...

  23. HOW TO: Remove Unused COM Ports for Re-assignment with Windows RealPort

    Expand the Multi-port serial adapters entry, right-click on the Digi device you want to change and chose Properties. In the Properties window, click the Advanced tab, followed by Properties. In the Advanced Properties window, click the desired port number on the left, then Serial. Chose an unused COM Port from the drop-down list and click Apply.

  24. Service Name and Transport Protocol Port Number Registry

    Port numbers are assigned in various ways, based on three ranges: System Ports (0-1023), User Ports (1024-49151), and the Dynamic and/or Private Ports ... * * * * ASSIGNMENT OF A PORT NUMBER DOES NOT IN ANY WAY IMPLY AN * * ENDORSEMENT OF AN APPLICATION OR PRODUCT, AND THE FACT THAT NETWORK * * TRAFFIC IS FLOWING TO OR FROM A REGISTERED PORT ...