Change driver DOS name

I want to change serial port device’s symbolic link (DOS name) and its same listed name from DevManager from another application.
Is it possible through SetupAPIs or devcon?

The actual dos device name (symbolic link) is changed with the DefineDosDevice API. You can get the existing device name mapping (i.e. what \Device\Xxxx name to create the new link for) by calling QueryDosDevice first. For the driver to pick up the new symbolic link name the next time it restarts, you need to write the new name to the “PortName” value in the dev node. To change the name shown in device manager you need to set the device’s friendly name property (query the device description property and then append the new symbolic link name to the string).

1 Like

Thanks!
I tested that DefineDosDevice can be used to delete the existing DOS Name and create a new DOS Name for the device name.
But the newly defined DOSName is not listed as a port in TeraTerm. Is there any way for this?

I did some experiments; i changed “PortName” in devnode and when the device is restarted, it appeared in TeraTerm. Because device init execute IoCreateSymbolicLink.

I am expecting similar behaviour with DefineDosDevice. May i know if i am correct?

Thanks in advance!

You probably need to update the SERIALCOMM key with the newly named port value.

Ok thanks!