How to Remove COM Ports Which Are In Use

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.


Tags: , , ,

  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

13 Responses to “How to Remove COM Ports Which Are In Use”

  1. Jay Sheldon says:

    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. FettesPS says:

    @Jay Sheldon – Can’t say that I’ve tried this in Windows 7 or Windows Vista.

  3. Kurt says:

    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.

  4. Patrick O'Keeffe says:

    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.

  5. David says:

    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

  6. Lars says:

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

  7. scott says:

    thanks Lars, works great!

  8. MikeE says:

    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.

  9. Joel says:

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

  10. Ace Zachary says:

    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.

  11. Eric says:

    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.

  12. Eric says:

    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.

  13. Helen says:

    Thanks Eric, did want you said and it cleared my problem.

Leave a Reply