Monitor ID and Serial Number

前端 未结 4 526
粉色の甜心
粉色の甜心 2021-01-16 06:16

In Windows we have information about our Monitros - some unique name and id. e.g.

  1. Acer xxx
  2. Samsung xxx

I have qeuestion how to get the

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-16 07:10

    root/CIMV2/Win32_DesktopMonitor/PnPDeviceID only show 2 of my 5 monitors and root/WMI/WMIMonitorId/InstanceName shows all 5 of my monitors

    strComputer = "." 
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI") 
    Set colItems = objWMIService.ExecQuery( _
        "SELECT * FROM WmiMonitorID",,48) 
    For Each objItem in colItems 
        Wscript.Echo "-----------------------------------"
        Wscript.Echo "WmiMonitorID instance"
        Wscript.Echo "-----------------------------------"
        Wscript.Echo "InstanceName: " & objItem.InstanceName
    Next
    

提交回复
热议问题