qiita.vbs
Sub getMonitors()
Dim m
Dim c
'https://learn.microsoft.com/ja-jp/windows/win32/wmicoreprov/wmimonitorid
For Each m In GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\.\root\WMI").ExecQuery _
("SELECT * FROM WmiMonitorID")
Debug.Print "InstanceName:" & m.InstanceName
Debug.Print "Active:" & m.Active
Debug.Print "ManufacturerName[]:";
For Each c In m.ManufacturerName
Debug.Print Chr(c);
Next
Debug.Print
'Debug.Print "ManufacturerNameLength:" & m.ManufacturerNameLength
Debug.Print "ProductCodeID[]:";
For Each c In m.ProductCodeID
Debug.Print Chr(c);
Next
Debug.Print
Debug.Print "SerialNumberID[]:";
For Each c In m.SerialNumberID
Debug.Print Chr(c);
Next
Debug.Print
Debug.Print "WeekOfManufacture:" & m.WeekOfManufacture
Debug.Print "YearOfManufacture:" & m.YearOfManufacture
Debug.Print "UserFriendlyName[]:"
'For Each c In m.UserFriendlyName
' Debug.Print Chr(c);
'Next
Debug.Print
'Debug.Print "UserFriendlyNameLength:" & m.ManufacturerNameLength
Debug.Print
Next
End Sub
出力結果
InstanceName:DISPLAY\PHLC217\4&f6e7055&0&UID224795_0
Active:True
ManufacturerName[]:PHL
ProductCodeID[]:C217
SerialNumberID[]:11xxxx
WeekOfManufacture:12
YearOfManufacture:2020
UserFriendlyName[]: