Created
May 27, 2018 12:23
-
-
Save liantian-cn/d69a02f3cb6844301bb1c4d57fba2f6b to your computer and use it in GitHub Desktop.
python wmimonitorid SerialNumberID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for obj in objWMI: | |
if obj.Active != None: | |
print("Active:" + str(obj.Active)) | |
if obj.InstanceName != None: | |
print("InstanceName:" + str(obj.InstanceName)) | |
if obj.ManufacturerName != None: | |
print("ManufacturerName:" + str(obj.ManufacturerName)) | |
if obj.ProductCodeID != None: | |
print("ProductCodeID:" + str(obj.ProductCodeID)) | |
if obj.SerialNumberID != None: | |
print("SerialNumberID:" + str(obj.SerialNumberID)) | |
print("SerialNumberID:" + ''.join(chr(i) for i in obj.SerialNumberID)) | |
print("") | |
print("########") | |
print("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from win32com.client import GetObject
objWMI = GetObject('winmgmts:\\.\root\WMI').InstancesOf('WmiMonitorID')