0

我正在寻找一种可以通过 VBScript 获取已连接操纵杆列表的方法,如下图所示(我的意思是它们的顺序非常重要):

joy.cpl 列出连接的操纵杆

4

1 回答 1

1

这是执行此操作的代码...在网上很难找到...

strComputer = "." Set objWMIService = GetObject("winmgmts:" _ &
"{impersonationLevel=impersonate}!\\" & strComputer & "oot\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from
Win32_PnPEntity")

For Each objItem in colItems

Wscript.Echo "Class GUID: " & objItem.ClassGuid
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Device ID: " & objItem.DeviceID
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "PNP Device ID: " & objItem.PNPDeviceID
Wscript.Echo "Service: " & objItem.Service

Next

希望会有所帮助

于 2012-07-26T08:11:22.773 回答