i've modified WMIQuery a little, to apply a filter to the result. but it isn't compatable to old version. So a made a new UDF
code:
$myArray = WMIQueryfilter("Description","Win32_PnPEntity",,"USB")
for each $device in $myArray
? $device
next
;****************************************************************************************************
FUNCTION WMIQueryfilter($what,$from,optional $computer,optional $where)
dim $strQuery, $objEnumerator, $value, $item, $ubound
dim $temp[0]
$strQuery = "Select " + $what + " From "+ $from
if not $computer $computer="@WKSTA" endif
$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//$computer")
$objEnumerator = $SystemSet.ExecQuery($strQuery)
if @error exit 1 return endif
For Each $objInstance in $objEnumerator
If @Error = 0 and $objInstance <> ""
$=execute("$$value = $$objInstance.$what")
Select
case VarType($value) & 8192
for each $item in $value
$ubound = ubound($temp)
if instr($item,$where)
if $temp[$ubound] >' '
$ubound = $ubound +1
redim preserve $temp[$ubound]
endif
$temp[$ubound] = $item
endif
next
case 1
$ubound = ubound($temp)
if instr($value,$where)
if $temp[$ubound] >' '
$ubound = $ubound +1
redim preserve $temp[$ubound]
endif
$temp[$ubound] = $value
endif
EndSelect
EndIf
Next
$WMIQueryfilter = $temp
ENDFUNCTION