List of SerialPorts queried using WMI differs from devicemanager?

后端 未结 4 1041
深忆病人
深忆病人 2020-12-17 19:37

I have the following serial ports listed in my devicemanager:

  • COM3
  • COM4 (BT)
  • COM5 (BT)
  • COM6 (GlobeTrotter MO67xx - Control Interface
4条回答
  •  鱼传尺愫
    2020-12-17 20:00

    I found the solution.

    The following query (root\CIMV2) gets the requested results:

    SELECT * FROM Win32_PnPEntity WHERE ClassGuid="{4d36e978-e325-11ce-bfc1-08002be10318}"
    

    Update

    This answer is pretty old now. Ehen I asked it I still had to consider WinXP and was using Windows7. Since I don't deal with serial ports any more, I can't give any new information on that issue. At that time this solution reported all ports that the devicemanager was showing. But I know listing serial ports is not that easy so this answer might not be correct in all scenarios.

提交回复
热议问题