Author Topic: Is there a way to get USB device information that's in windows "device manager"  (Read 12771 times)

rebar

  • Member
  • ***
  • Posts: 17
Is there a way to get USB device information that's in windows "device manager" programmatically using python or a dos command prompt or... ?

I know the PID and VID of the device of interest.

Below are two examples of device manager info that I'm trying to get ,

from property -> hardware IDs , this is the consumer control page 0x0C, collection 1

HID\VID_047F&PID_4304&REV_1030&MI_03&Col01
HID\VID_047F&PID_4304&MI_03&Col01
HID\VID_047F&UP:000C_U:0001
HID_DEVICE_SYSTEM_CONSUMER
HID_DEVICE_UP:000C_U:0001
HID_DEVICE

here is another example, the vendor unique page 0xFFA2, collection 3

HID\VID_047F&PID_4304&REV_1030&MI_03&Col03
HID\VID_047F&PID_4304&MI_03&Col03
HID\VID_047F&UP:FFA2_U:0003
HID_DEVICE_UP:FFA2_U:0003
HID_DEVICE_UPR:FF00-FFFF
HID_DEVICE

I'd be ok with launching something in windows that creates a text file that I could parse, but I don't see anything text-based like device manager.

Thanks!

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research

bpaddock

  • Frequent Contributor
  • ****
  • Posts: 66
Is there a way to get USB device information that's in windows "device manager" programmatically using python or a dos command prompt or... ?

Here is some short code I wrote in C, LONG ago, that shows how to use the SetupAPI to find USB and Serial COM ports:
http://graceindustries.info/pgmupdates/ports_get/

I got tired of support calls asking "What COM Port do I have?".  How would I know, it is your computer...
All my programs now automatically find them so don't get that question anymore.

rebar

  • Member
  • ***
  • Posts: 17
Thanks for the suggestions! devcon.exe gets me close enough for now,

C:\devcon>devcon find HID\VID_047F*
HID\VID_047F&PID_02F7&MI_03&COL04\8&1676A1BD&0&0003         : HID-compliant vendor-defined device
HID\VID_047F&PID_02F7&MI_03&COL01\8&1676A1BD&0&0000         : HID-compliant headset
HID\VID_047F&PID_02F7&MI_03&COL02\8&1676A1BD&0&0001         : HID-compliant consumer control device
HID\VID_047F&PID_02F7&MI_03&COL03\8&1676A1BD&0&0002         : HID-compliant vendor-defined device