How to change COM-port with script?
Hi,
I have a MSI (mobilink.msi) which installs drivers for a UMTS/HSPDA-modem.
However after installation the modem is installed at COM6, but this port is already used by another application, so we have to change the COM-port manually to COM8.
I have tried to capture this change, but I did not succeed.
So does anyone knows a script to change the COM-port for a device/modem?
I have a MSI (mobilink.msi) which installs drivers for a UMTS/HSPDA-modem.
However after installation the modem is installed at COM6, but this port is already used by another application, so we have to change the COM-port manually to COM8.
I have tried to capture this change, but I did not succeed.
So does anyone knows a script to change the COM-port for a device/modem?
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
anonymous_9363
16 years ago
ORIGINAL: Jemboy2004In all likelihood, whatever you used to capture had the relevant files/registry keys excluded.
I have tried to capture this change, but I did not succeed.
Use ProcMon - with 'Enabled advanced output' switched on - as you change the COM port: that will definitely tell you what goes on during the change.
Posted by:
aogilmor
16 years ago
ORIGINAL: Jemboy2004
I have a MSI (mobilink.msi) which installs drivers for a UMTS/HSPDA-modem.
However after installation the modem is installed at COM6, but this port is already used by another application, so we have to change the COM-port manually to COM8.
I have tried to capture this change, but I did not succeed.
So does anyone now a script to change the COM-port for a device/modem?
Look into the Win32_PortResource and Win32_PortConnector classes in WMI. I'd be surprised if there wasn't a utility somewhere to locate free com ports, you could add that to the mst as a custom action. Try to locate where it sets the com port and see if the value can be replaced by a property. Does the string COM6 exist anywhere in the MSI?
Posted by:
anonymous_9363
16 years ago
ORIGINAL: aogilmorHi, Owen. I found any number of ActiveX controls in a Google search and presumed the OP would have done the same. From what I gather, though, they are almost exclusively to allow script control of stuff like a port's baud rate and so on. I would imagine that the setting for this app would likely be some custom registry setting anyway.
I'd be surprised if there wasn't a utility somewhere to locate free com ports,
Posted by:
aogilmor
16 years ago
ORIGINAL: VBScab
Hi, Owen. I found any number of ActiveX controls in a Google search and presumed the OP would have done the same. From what I gather, though, they are almost exclusively to allow script control of stuff like a port's baud rate and so on. I would imagine that the setting for this app would likely be some custom registry setting anyway.
Hi Ian, yeah, I was just wondering though why COM6? That seems strange, and kind of weird that it would be in use. I thought COM ports were pretty much obsolete by now since things are all USB and high speed network ports. So maybe it is hard coded somewhere and could be changed by a property. All he really needs to do (presumably) is read the first available free com port and let the MSI property do the rest....maybe, if it's that easy [:)]
Posted by:
Jemboy2004
16 years ago
I believe every communication device even if it uses USB, uses COM-ports. Mobilink is a driver software for a UMTS modem thus it uses a COM-port. The problem I have is that the other software (GPS) uses COM6 (I can not changed this). However because during the RIS, the dockingstation with the build-in GPS-mouse is not connected, COM6 seems free, and Mobilink (Vendor Package) installs on the first free COM-port. Because this causes conflicts when the laptop is connected to the dockingstation and the GPS-software is activeated, we manually change the modem port to COM8.... but ofcourse I would prefere to do the COM change using a script. I have looked at the MSI, but I haven't found a property to set the modem port (yet)....
I had a look at WMI earlier but the the COM settings seemed more read-only, but I'll have another look lateron. Thanks for all your help so far!
I had a look at WMI earlier but the the COM settings seemed more read-only, but I'll have another look lateron. Thanks for all your help so far!
Posted by:
anonymous_9363
16 years ago
I think you may be making this more complex than it actually is. I think you can avoid the mess of actually talking to and setting the COM port: all you need to find out is how this application records the port it's to connect to. In that case, as I originally suggested, ProcMon will show you that happening as you switch between them.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.