Display Active Serial Comm? Ports, including USB adapters

Forums Desktop Info Display Active Serial Comm? Ports, including USB adapters

This topic contains 4 replies, has 2 voices, and was last updated by Avatar Nigel 1 week, 3 days ago.

  • Author
    Posts
  • #1602 Reply
    Avatar
    Nigel

    Hi, I have been trying to get DI to display the active serial port(s), so that when I plug in the USB adapter I know where to point putty to establish communications. I have had no success. I have tried the WMI function with MSSerial_PortName to catch instances of the USB virtual ports without success.

    I wish I could turn on debug for a block of code in the ini file but DI does not seem to offer that functionality. Possible future feature request.

    Any assistance will be appreciated.

    See reference https://stackoverflow.com/questions/19840811/list-of-serialports-queried-using-wmi-differs-from-devicemanager

    0
  • #1603 Reply
    Glenn
    Glenn
    Keymaster

    WMI Explorer is your friend.

    I have a Prolific USB-to-Serial Comm Port:

    It shows up in MSSerial_PortName if I “Run As Admin”

    It doesn’t show in win32_SerialPort at all.

    It shows up in Win32_PnPEntity without requiring admin access. But because this is a list of all PNP devices, i have to set a where clause to isolate it and then there’s no single property showing the COM port, it’s tacked on the end of the caption which may get cropped on the display.

    Win32_PnPEntity where pnpclass=”Ports”
    or
    Win32_PnPEntity where name like “%(COM%”

    I’d like to use the DeviceID property to query MSSerial_PortName for the COM port but that requires escaping certain characters which DTI doesn’t do.

    So, right now, the closest I can get is either:
    namespace:root\cimv2,query:Win32_PnPEntity where name like “%(COM%”
    or
    namespace:root\wmi,query:MSSerial_PortName
    which requires Admin access. While it’s not ideal, it does give you the vital clues of USB and COM port.

    1+
  • #1604 Reply
    Glenn
    Glenn
    Keymaster

    All of the above is Win10 1803. I note that MSSerial_PortName doesn’t seem to work at all on my Win7 Pro box.

    0
  • #1605 Reply
    Avatar
    Nigel

    Thanks Glenn, I used the information you provided, and I came up with this for my Win7 Pro box, and, it works for me. Thanks for the help, this gives me sufficient to start with. I now have to test against different USB serial adapters to see if it is consistent. Thanks for the help and the ideas for a solution.

    The code I am using is as follows:

    WMI=active:1,interval:60,color:88ff44:namespace:root\cimv2,query:Win32_PnPEntity where Description like “USB Serial Port”,display:%Caption%

    0
  • #1606 Reply
    Avatar
    Nigel

    Hi, first set of tests failed, slight modification of key word search works better. Needs more testing, apparently different manufactures adapters report different id strings and will have to be parsed differently.

    e.g.,

    WMI=active:1,interval:60,color:88ff44:namespace:root\cimv2,query:Win32_PnPEntity where Description like “%Serial% %Port%”,display:%Caption%

    1+
Reply To: Display Active Serial Comm? Ports, including USB adapters
Your information:




Do NOT follow this link or you will be banned from the site!