How to Remove COM Ports Which Are In Use

October 15, 2009

If you do a fair amount of developing with serial devices then you eventually reach a point where your computer has 20 or 30 comm ports listed as “in use.” This can become a rather large annoyance when working with programs that only allow you to use the first 10 ports. Sure, you can manually set a device to use a port that’s listed as “in use” but this could potentially cause issues.

There’s a trick that will let you see the hidden devices that are eating up your COM ports:

  1. Enter set devmgr_show_nonpresent_devices=1 into Command Prompt
  2. Open Device Manager
  3. Click View -> Show Hidden Devices

Now when you expand the section on COM ports, the non present COM ports will be in grey. You can now easily remove any unwanted devices that are tying up COM ports by Right Clicking then selecting Uninstall. After you are done, should you wish to hide these devices again you can do so by entering
set devmgr_show_nonpresent_devices=0 in Command Prompt.

Only registered users can comment.

  1. I have tried this in Win 7 x64 and I do not see the ports that are not connected. I am using a USB to Serial adapter (FTDI รขโ‚ฌโ€œ virtual com) and when the usb side of the device is connected to the computer it shows in Device Manager, when the usb side of the device is not connected to the computer is does not show in Device Manager (even when using your directions)

    Please advise!

  2. I can confirm that this didn’t work on Win 7 64. However, I have a tripplite serial adapter and it lets you change the com port to one that windows thinks is already in use. I changed it from Com 11 to com 3 and it’s working good. No hack necessary.

  3. This won’t work (at least on Windows XP SP3) until the computer is restarted. Minor but important and very inconvenient step. Thanks MS for the hassle.

  4. Hi

    I have a situation that I have installed 3 usb to serial hubs to connect 10 POS for text overlay. I am only able to setup 2 ports. All the others it states are in use – currently it shows 14 com ports only com11 and 14 I can use. but the rest it states are in use. How do I release the com ports with in windows 7 and how do I see what devices are using them

  5. I got this to work on Windows 7 64bit! 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. Enter “start devmgmt.msc”

    4. In the box that opens, select “Show hidden devices” in the ‘view’ menu.

    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).

  6. One thing that “I” found to work. The above did not work for me as the ports were “(In Use)” but no device was listed. I had the lower 4 com ports “(In Use)” when i knew that the system only had one physical port. I used the advance button to assign the one actual port (COM1) to the other 3 “(In Use)” ports and then back to COM1. This effectively cleared the “(In Use)” status and the virtual drivers were then able to assign to 2,3,4,etc.,

    Hope this might help someone else if the above doesnt fix their problem.

  7. Confirmed what Lars did. Worked great. Thanks! Developing using FTDI and this has become a serious issue. Appreciate the help of this site.

  8. Thanks a lot!!. It’s important to right click on cmd.exe and choose run as admin. Running the cmd from the RUN with admin privilege will not work.

  9. I’ve encountered this on Server 2003. I used the steps here and it made one disabled COM port appear, but none of the others. I had been using a Moxa NPort to simulate COM ports. Even after uninstalling the driver software for that, many of the COM ports it created remain and show as in-use. Any other ideas? Sure this is managed in the registry somewhere.

  10. I found a work-around. It’s ugly, and offends my engineering sensibilities, but it works. What I ultimately did to clear the offending ports was to assign the port number of COM1 (the one real physical COM port) to each of the offending port numbers, accept the warning that it was in use, and then, after having assigned it each of the in-use numbers, returned it to COM1. After that, all COM ports were available.

  11. Hi , how do I uninstall around 150 com ports or more then that in single shot ?

    Is there any comment?

  12. Hi ,

    I got it. Install DeviceCleanup tool and delete unwanted COM ports in a secs. Thanks.

Leave a Reply

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

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