Code: Select all
wmic path CIM_LogicalDevice where "Description like 'USB%'" get /value
Caption=USB2.0 PC CAMERA
ClassGuid={6bdd1fc6-810f-11d0-bec7-08002be2092f}
CompatibleID={"USB\Class_0e&SubClass_03&Prot_00","USB\Class_0e&SubClass_03","USB\Class_0e"}
ConfigManagerErrorCode=0
ConfigManagerUserConfig=FALSE
CreationClassName=Win32_PnPEntity
Description=USB Video Device
DeviceID=USB\VID_18EC&PID_3299&MI_00\6&14F3076D&2&0000
ErrorCleared=
ErrorDescription=
HardwareID={"USB\VID_18EC&PID_3299&REV_0100&MI_00","USB\VID_18EC&PID_3299&MI_00"}
InstallDate=
LastErrorCode=
Manufacturer=Microsoft
Name=USB2.0 PC CAMERA
PNPDeviceID=USB\VID_18EC&PID_3299&MI_00\6&14F3076D&2&0000
PowerManagementCapabilities=
PowerManagementSupported=
Service=usbvideo
Status=OK
StatusInfo=
SystemCreationClassName=Win32_ComputerSystem
SystemName=PC
The challenge I have now is (1) how to find the wmic command that queries the above data, or rather only the 'Caption' value and tells me whether it matches a certain string (viz, 'USB2.0 PC CAMERA'). Or, better: I want (2) a way of searching all my - connected! - USB devices for the string.
Any ideas? The wmic syntax looks forbidding. Also, task 2 might require a Powershell or DOS or Virtual Basic script . .