When you connect devices to a computer using COM physical ports or USB ports (depending on the device connected) they get a COM port number assigned that you can see in your device manager, under “Ports” section. The thing you should keep in mind is that under this section you can only see the ports that are currently in use.
I won’t get into more details than needed like the devices that you can connect because this is not the purpose of this article. This and many more things regarding COM/USB/LPT ports will be covered in a future article in here but for now you can search the web for these terms and find out more about them.
What I will try to explain and I hope it will be of help for those of you that have this issue is how to re-activate or make COM ports available although they seem to be unusable. If you are using some terminal emulator like putty or even emulators for networked ports like http://nport-administration-suite-ver1-9.software.informer.com chances are you have this issue and you can’t use a specific COM port that your application or software wants, due to the fact that it is not available in the list for the use/map/link of ports. It will probably lack from the list and if by whatever reason you do find it and try to change the default assigned COM ports, you will get a different error (depending on the software you are using) that the port is protected by the operating system, or that the port is locked or protected.
You can see all COM ports IN USE at current time in your device manager, like in the next picture:
In the above picture, COM1 is the available (in use) physical port of my workstation. I could add some screens with errors you can get from different software that you can use to administer or interface with these ports but some were already mentioned and the rest are too many and irrelevant to the subject.
What you need to know and the general idea behind all this subject is that Windows assigns a port number each time you plug in a device, like a printer for example. If you remove it and plug it in again, the old port number might be left behind, not being deleted and the same device might get a different port number assigned to it each time and so on. Now imagine some of the software and applications you will be using to interface with these ports only recognize and can use a certain number of ports. This certain and maximum ports number for a few of these applications is 9.
What you have to do is to clear or remove those old assigned ports and not in use anymore from system history. But as we already know you can only see those that are in use. I will show you how to make them visible in device manager in order to uninstall/clear them.
SOLUTION to Make COM Ports available:
1. Go to Start – Run and type in “devmgmt.msc” without the quotes and press Enter from your keyboard or in the same Run dialogue use “compmgmt.msc” without the quotes and press Enter and navigate to “Device Manager” by left clicking on it to select it.
2. Now if you expand the “Ports” section from device manager you can see the available ports as in my print screen.
3. The first two steps above were more to see the “in use” ports in case you didn’t do that already. Now to continue, go once again to Start – Run and type in “sysdm.cpl” without the quotes and press Enter from your keyboard. Navigate to “advanced” tab and then select the “Environment Variables” button:
4. The second bottom part of the Environment Variables window is called “System Variables” section, as you can see in the picture below. Further you will have to click the “New” button.
5. The new window that will appear after you follow step 4 should look something like below picture but keep in mind that by default those fields will be empty. You will have to fill them as I filled them in the next screenshot:
Variable name: DEVMGR_SHOW_NONPRESENT_DEVICES
Variable value: 1
6. Confirm all the next windows with Ok so that you will have only Device Manager Window opened (and whatever else you were using/running before this article), should be no more than 2 “Ok”s.
7. Go back to the window with Device Manager (step 2) – Ports section. From the top menu select “View” and check the “Show hidden devices” option as you can see below:
8. Assuming you had such ports assigned but not in use, new ports will appear under Ports sections which are in fact the hidden not-in-use ones. You can use right click on the desired ports and “uninstall” option for those you want to be removed, those you know your computer is not using anymore.
Note: You should keep in mind that you could have several different COM ports assigned with the same name for example for a device and the only thing that will be different will be the port number e.g. COM2 and COM4 for the same device. For example, a printer you connected a few times might have assigned 2, 3 or even more COM ports numbers and just to have a complete example, we will call it Printer 1 and it will look something like this in your device manager:
The last port number assigned should be the current one, the highest assigned, so in this case you would UNINSTALL (remove) COM4 and COM7 registration from the list.
One more thing to add here is that there are devices that can use multiple ports to communicate, mostly for software that work with virtual technologies (virtual serial ports) or that use features. So you can see the same device name or port name with multiple COM port numbers assigned. Don’t delete those unless you really know what you are doing, else you might have to re-install the solution/application/software/driver.
9. Now you can re-allocate (assign) the free COM port numbers to existing ones from your device manager by going to Start – Run – “devmgmt.msc”, press Enter from your keyboard. Furthermore select and right click the device port that you want to change port number for and go to properties. Select Port Settings tab and click advanced as you can see below:
When you hit the “advanced” button as in above picture, you will open a window like the one below and from the pick list saying “COM Port Number” select a different port number that you just released from use and you want to have as active for this particular device.
Depending on the software and applications you are using, there might be additional options or required settings or changes you will have to do to so that this change can be applied (for example the Nport Administration mentioned above that can bypass the port number change you did in device manager as long as the ports are not “in use”). This port number change can also be done from the particular application you are trying to modify, if it does support such changes.
If the information above is not precisely accurate in terms that it doesn’t completely match your operating system or due to whatever reasons it might slightly differ from your environment you might have to read the manual or do a bit of web research by yourself. Also, I am here in case you don’t find the solution you were looking for in this article or any other material you have found on the web.