How to list device types using WMI?

I am using WMI Code Creator to create code to display the types of devices displayed in device manager. I am trying to detect the presence of a debugger that appears in the device manager as a native type (for example, in the list under my computer, categories "Computer", "Disk Drives", "Display Adapters", "Jungo"). Jungo is the one I want)

Under Jungo, PEMicro USB Multilink (i0) and the PEMicro USB serial port (i1) appear. I'm just trying to verify that the device is present and detected by windows before proceeding.

What is the correct namespace? Is this root \ CIMV2? If so, what class and what properties will it be?

I do not have prior WMI experience, so let me know what additional information would be helpful.

+3
source share
1 answer

Check out the sample snippet that displays all 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
+5
source

Source: https://habr.com/ru/post/1720603/


All Articles