Tuesday, December 12, 2017

How to remove unused USB serial ports in windows and change port numbers

Sometimes when you connect usb to serial adapter to your pc it gets com number with very high numbers. Not every software can handle that big port numbers. For example some programs cannot work with port numbers higher than com20. So if 20 com ports are in use it is impossible to use that software.  That happens because every time you plug in new USB to serial adapter it gets new com port number, and even if you do not use it anymore port is marked as "in use".
To delete these ports open elevated command prompt: find cmd, right click on it and select "run as administrator".
Then type:

set DEVMGR_SHOW_NONPRESENT_DEVICES=1

after that run device manager:

devmgmt.msc

Enable "Show hidden devices" in the "View" menu, and uninstall grayed-out COM ports

After that you can change your device com port number: right click on it, select properties, then  advanced setting.