Community discussion forum

How to change COM port number

  • 4 years ago

    I need to write a program to list all of the available COM ports on a computer and allow the operator to change the COM port number. I can get the list of available COM ports using the WMI but how to I change the COM port number?


    Thanks,

    q

  • 4 years ago

    hi! are you re4feering to MS Comm component? if so, just put the com port num to mscomm1.commport = <port num>... that's all

     

    john

  • 4 years ago

    No, I'm not trying to open the COM port, I want to change the COM port number of a serial port.

    I would like to programmatically bring up the Advanced Settings window under the Device Manager for the serial port. I can get to the COM Port Properties window by using:

     shell("rundll32.exe devmgr.dll,DeviceProperties_RunDLL /DeviceID acpi\pnp0501\1"

    But I still have to click on the Port Settings tab followed by the Advanced button.  Does anyone know of another way to get to the Advanced Settings window automatically?


    Thanks,
    quantum1976









Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter or Facebook!