2
votes

How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows?

To manually perform the operation I can follow the steps described in
link text

Open Device Manager with devmgmt.msc

Double-click Ports (COM & LPT).

Right-click the port I want, and then click Properties.

On the Port Settings tab, if I want to change the COM port number (for example, from COM1 to COM51), I click the Advanced button, and then select the COM port number I need from the list.

But, how can I do the job with a program? Is there an API to do the job? Thank you.

2

2 Answers

2
votes

I don't know any API to achieve that, but you can edit the registry values under HKLM\Hardware\DEVICEMAP\SERIALCOMM