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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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.

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.


Author Comment

ID: 35140981
Found what I think is the INF. It's attached as a text file. oem108.txt
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

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…
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 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