Friday, January 30, 2009

How to clear or Reset COM port ?

Windows always assign a COM port no (like COM2, COM3 etc) every time you connect a USB device like modem, mobile phone or specially serial to USB convertors to system, and this no goes on increasing as every time you connect device windows reserve that port and next time it assign new number.

I recently face some issue because of this, I want to test my new thing magic m5e RFID Reader with BizTalk RFID which is connected to USB of my laptop using a serial to USB convertor, here my system assign a port no COM19, this was a big problem for me as my RFID Device Provider can only access up to COM5 ( it is in pre-beta)  so i need to change COM port to less than COM5, when I tried to do that it shows me list of all 19 ports and mentioned in brackets as “in use”, so i need to free all these ports which are locked by system. I searched every where in device manager , control panel no interface is available to do this in windows, then i found a nice solution for this which allow you to free all ports but for this you need to edit registry,

here are the steps which you can use to free all post.

  1. Click start –> Run –> type regedit and click OK button.
  2. This will open a Registry editor.
  3. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter

regedit - comp port

Now right panel , you can see a key ComDB  right click to that key and click modify.  ComDB

In value Data section select all and delete  reset to Zero ‘0’.

click OK

Close Registry editor and then restart your computer. all COM ports are now Free, you may  need to reinstall any USB to serial convertor.

Note: It is always good to take back up before deleting any entry from Registry, to take back up for Com Name Arbiter, in left panel right click on COM Name Arbiter and say Export, save with some name and appropriate location.

41 comments:

Anonymous said...

Thanks Mahesh,Very useful information, just one suggestion, can you please make those screenshots in PNG instead of JPEG, will be more clear and also will ease for you in uploading.

Unknown said...

Thanks Mahesh

Unknown said...

Thank you - I've wondered how to do that for a long time now. Mine was up to com55! Now everything's more sane - you rock.

Anonymous said...

Mahesh, will this wipe out physical COM ports in Windows as well and make, say COM1, unavailable?

Uwe Sieber said...

Based upon the information on this page I have just made a little tool for this:
http://www.uwe-sieber.de/files/com_name_arbiter_setter.zip

Uwe Sieber

Anonymous said...

Will resetting the port arbitor work in WinVista and 7 as well? Will it wipe out Windows physical ports COM1 & 2? Thanks!

Anonymous said...

Can someone test this in Windows 7 32 & 64 bit O.S.? Also, it should be noted to uninstall and then unplug any serial to USB adapters/harware.

Anonymous said...

I used this procedure months ago when my Win 7/64 machine got itself up to about comm10. It works perfectly and is completely safe if you're comfortable poking around the registry.

Anonymous said...

wow!! exactly what i'm searching..u are brilliant! thank you!

Anonymous said...

Just what I needed. I ow you a cup of coffee

Anonymous said...

Looked at my registry, and value was 1c. The last device I added was COM5. I deleted it, and the regis. val. was 0c. Knowing that the binary for 1c was 00011100, I concluded that the bits, right to left were for COM1-COM8. Wrote the Registry from 0c to 08 (thinking I'd free COM3). When I reinserted the device I had deleted, it was assigned COM3. Looks like you can selectively clear COM port numbers, if you choose. Also, looks like COM1 and 2 are already zero - and not available to the user.

Anonymous said...

Absolutely great Op , and thanks for making it easier Uwe , mine was up to 26 and i was getting lost...

commuter676 said...

Pure Genius! Thanks.

Anonymous said...

Awesome, thanks! For those worrying, I set all to 0 on my Win7-64 (pro) and COM1 and LPT1 were both preserved. We're good now.

Anonymous said...

Awesome, this worked a treat in Windows 7 32-bit on a bunch of Com Ports that showed open/still in use even after removing ghosted devices.

(I found Ghostbuster for that)

Thanks so much!

Anonymous said...

When you say reset to zero are you saying to simply type 0 in the data section and close? Not 00. as they appear.

Thanks.

Richard

Anonymous said...

I was looking for it.... Suddenlt ur post came to me like a charm... thats useful post...

Anonymous said...

win 7 64bit, does not work...

Anonymous said...

I work with Samsung smartphones, and each and every one installs new virtual COM ports for modem and diagnostics interface... I've gotten to COM1024 before I started having problems with using the newly registered ones. USBdeview let me uninstall the devices en masse, but it couldn't do anything about the COM port number issue. This little trick saved me a possible Windows reinstall, so thank you very much :)

Tibor

Mirfster said...

Hello all, I have been doing a fair amount of testing with USB AirCards and noticed the same thing. However, even after doing the steps that pointed out, I discovered that if you look under “Printer Server Properties” in the “Ports” section you will still see all the COM Ports.

Trying to delete these (with Admin Rights) results in the error: “Selected port cannot be deleted. The request is not supported”

I am running Win7 x64, anyone else see the same thing?

Unknown said...

wow it's work
thankz

Kurt said...

Thank you very much!

I wasn't able to program Arduino's anymore using a laptop that I used many times before for that purpose with success.

Have been fighting all day with it, checking cables, installing new drivers, new software, disabling/enabling services, bluetooth, restarting again and again...

However the USBtoCOM driver always picked an unused port, it was remarkable how many ports were supposedly in use.

Used your tip, and finally... all works fine again!

Thank you, I appreciate it very much when people unselfishly post their knowledge on-line...

Unknown said...

Hi I've done what you said in the post to delete all my COM ports but now, I'm trying to connect an Arduino for the first time to the computer and for some reason it's not being recognized. I really don't know why but it seems that to my computer there are no ports connected even if I have the Arduino plugged-in. Do you know what can be happening? Thank you

Anonymous said...

Didn't work on windows 7 for me : (

Anonymous said...

Thanks very much. Have been looking for this resolution for ages. Worked a treat on my Windows 7 OS

Anonymous said...

GReat . Thanks. win 7 64 bits

Anonymous said...

thanks so much, I was searching since too much time

Anonymous said...

Thanks, worked on my Vista machine, the hard part was finding the run prompt. Just click start-search, type "run"

saleem said...

Brilliant!!!

My pc was on port 143 already...

Great stuff!!!

Thank you ever so kindly!!!

Anonymous said...

Worked great! Thank you!!!

Anonymous said...

Excellent!
Thank you for posting this. I'm involved in production testing using USB-Serial adapters and WindowsXP would assign a new COM number to each subsequent unit. You can imagine what kind of issues this created after 255 tested items! I had to search a number of forums before landing on this gem. Thanks!

Anonymous said...

Big tHx Excellent :)

Anonymous said...

Marvellous!! Many Thanks!

Anonymous said...

I used this on my Windows 7 machine and it works fine. thanks!!

Unknown said...

Marvellous work. Did this on NY XP is laptop and worked great. Cheers. I'll be able to do mums laptop now.

Anonymous said...

great proggie Uwe. Also works in windows 10

Anonymous said...

GOOD JOB SIR
Saved me all those reboots in the past. P.S. that means the regedit clear can be done and no reboot is required.

Mikkel Ridley said...

I know this is a very old post, but it was very helpful in finally figuring out why a device just wouldn't load. I suspect that Windows might go through every port and check if it is open, starting at #1, and this can cause the driver installation to time out (in my case it is a device that was trying to load a virtual com port after the device itself had already installed correctly). This thread helped me find the answer to the problem, so I just want to thank the OP and all the commenters.
And a special thanks to Uwe Sieber for creating the tool!
It saved me possibly hours of work manually uninstalling each com port (there were 256 of them!). See his comment above to get the tool.

fafasfas said...

Well, this works perfectly, thank you very much!

John22alen said...

nice write up. How to view your windows PC serial Number via CMD.

Yun Chieh 20150123 said...

pretty cool, thank you