0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

vbsでモニタのシリアル番号などの情報取得

Posted at

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[]:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?