How do I list device types using WMI?

后端 未结 1 733
-上瘾入骨i
-上瘾入骨i 2021-01-21 04:49

I\'m using WMI Code Creator to generate code to help list the types of devices shown in Device Manager. I\'m trying to detect the presence of a debugger that shows up in Device

相关标签:
1条回答
  • 2021-01-21 05:29

    Checkout the sample snippet which displays all the installed devices on your computer.

    strComputer = "." 
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
    Set colItems = objWMIService.ExecQuery( _
        "SELECT * FROM Win32_PnPSignedDriver",,48) 
    For Each objItem in colItems 
        Wscript.Echo "-----------------------------------"
        Wscript.Echo "Win32_PnPSignedDriver instance"
        Wscript.Echo "-----------------------------------"
        Wscript.Echo "DeviceName: " & objItem.DeviceName
    Next
    
    0 讨论(0)
提交回复
热议问题