|
strComputer = "."
Set objWMIService = GetObject(_
"winmgmts:\\" & strComputer & "\root\cimv2")
Query = "Select * from Win32_PnPEntity"
Set PnPEntity = objWMIService.ExecQuery( Query )
For Each objItem in PnPEntity
if instr( Ucase(objItem.Caption), "ENHANCED" ) <> 0 or _
instr( Ucase(objItem.Caption), "エンハンス" ) <> 0 then
ListUSBControllerDevice(objItem.DeviceID & "")
end if
Next
Function ListUSBControllerDevice(DeviceID)
Query = "select * from Win32_USBControllerDevice"
Set USBControllerDevice = objWMIService.ExecQuery( Query )
For Each objItem in USBControllerDevice
if instr( Replace( Ucase(objItem.Antecedent), "\\", "\"), _
Ucase(DeviceID) ) <> 0 then
ListControllerDevice(objItem)
end if
Next
End Function
Function ListControllerDevice(objItem)
aData = Split(objItem.Dependent & "", """")
Query = "Select * from Win32_PnPEntity where DeviceID = """ & aData(1) & """"
Set PnPEntity = objWMIService.ExecQuery( Query )
For Each objItem in PnPEntity
Wscript.Echo objItem.Name
Next
End Function
| |