How to use devcon to change the com port used by a device

Posted on 2011-03-14
Last Modified: 2012-05-11
I am trying to write a bat file that will change the auto-selected com port used by a device to com port 8. I have a USB GPS device that needs to be on port 8. Once I install it on com port 8 then move it to another USB port I have to change the port that it is defaulted to back to com port 8. I need a BAT file that will do this for me. I believe using "devcon" from a command prompt may help but i just can't find any examples out there that show me how.
Question by:csd32129
  • 4
  • 3
LVL 51

Expert Comment

ID: 35139616
I don't think you can reassign like that using Devcon.

I *think* that Xp should remember this device if you plug it into each USB port and configure the Com port.

Is this not the case?

If not, please post the INF from the driver for this device.

Author Comment

ID: 35140746
It does remember the port once the settings have been changed but we use a USB hub and if I have to replace the hub then I have to fix the settings on all 28 possible ports it could be plugged into. I can not find an INF driver for this device. The drivers listed are serenum.sys and ser2pl.sys. They install via an exe file.
LVL 51

Expert Comment

ID: 35140808

See if you can find an OEM*.inf file in C:\Windows\Inf that relates to these drivers and post it.

Otherwise, I'm sure devcon isn't capable of this - which isn't surprising.  The INF might allow us to hardcode the COM port.


Author Comment

ID: 35140981
Found what I think is the INF. It's attached as a text file. oem108.txt
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

LVL 51

Expert Comment

ID: 35141110
Can you search your registry and export this key and its content?



Author Comment

ID: 35141363
Here are a few of the keys I found. There were several found in the search these are just the first few.  keys.txt key2.txt key3.txt key4.txt key5.txt
LVL 51

Accepted Solution

Netman66 earned 500 total points
ID: 35141432
Ok, from what I've been able to gather up, you cannot assign a COM port number directly upon installation.  

The PnP enumerator uses APIs to call the ComDB and get the next free port number.

Apparently, there isn't a way to get around this that I've been able to find.

I guess you can keep using specific ports on the PC directly or the likelihood of the USB hub going bad isn't going to be high or happen often - so if all the ports have been mapped properly now, simply keep working with them as they are.

Sorry I couldn't offer up anything exciting!  It wasn't for the lack of trying though - I dug deep to try to understand a workaround, but I just don't think it exists.

LVL 59

Expert Comment

ID: 35390555
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT ( The crux of this batch f…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With  eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now