Finding & Removing Hidden COM ports for Non-connected Devices in Windows XP
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.
2. When the System Properties dialog window opens, click on the Advanced tab then click on the Environment Variables button.
3. In the Environment Variables window, under System variables, click the New button.
4. In the New System Variable dialog box, enter devmgr_show_nonpresent_devices as the Variable name, and enter 1 as the Variable value, then click OK.
5. You will see your new entry in the System variables field. Click OK.
6. Now click on the Hardware tab in System Properties and click on Device Manager.
7. Go to the View menu in Device Manager and click on Show hidden devices.
8. Scroll down to the Ports section and you will be able to see all the hidden and unused COM ports. In this particular example, there are seven hidden COM ports showing. You will now be able to see all hidden devices every time you enable Show hidden devices in Device Manager.
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.
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.
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 the Start | Control Panel | System | Hardware | Device Manager.
2. When the Systems Properties dialog window opens, click on the Hardware tab.
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.
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.
7. When the Run dialog box opens, type cmd.exe and hit enter or click OK.
8. When the cmd window opens, type set devmgr_show_nonpresent_devices=1 then hit Enter.
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.)
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.