如何使用WMI我列出的设备类型?如何使用、设备类型、WMI

2023-09-03 05:56:29 作者:纯种、小孩。

我使用WMI code造物主产生code,帮助列出在设备管理器中显示的设备类型。我试图检测调试器,在设备管理器中显示为它自己的类型(例如,在我的电脑上市,类别有:计算机,磁盘驱动器,显示适配器,Jungo公司的presence .....淳吾是一个我想要的)

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 manager as its own type (e.g. Listed under my computer, the categories are Computer, Disk drives, Display adapters, Jungo..... Jungo is the one I want)

在Jungo公司,PEMicro USB多链路(I0)和PEMicro USB串行端口(I1)显示。我只是想验证该设备是present和之前继续窗口检测。

Under Jungo, PEMicro USB Multilink (i0) and PEMicro USB Serial Port (i1) show up. I'm simply trying to verify that the device is present and detected by windows prior to continuing.

什么是正确的命名空间?它是根\ CIMV2?如果是这样,什么课,什么属性会变成这样?

What is the proper namespace? Is it root\CIMV2? If so, what Class, and what properties would this be?

我道歉,如果这个问题没有得到很好的描述,我之前没有任何WMI的经验,所以让我知道更多的信息将是有益的。谢谢你。

I apologize if this question is not well described, I have no prior WMI experience, so let me know what additional information would be helpful. Thanks.

推荐答案

结帐您的计算机上显示所有已安装的设备的示例代码段。

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