PORTS Forum

Ports and Interfaces => USB => Topic started by: rebar on July 25, 2019, 07:11:31 pm

Title: Is there a way to get USB device information that's in windows "device manager"
Post by: rebar on July 25, 2019, 07:11:31 pm
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!
Title: Re: Is there a way to get USB device information that's in windows "device manager"
Post by: Jan Axelson on July 25, 2019, 08:31:19 pm
Take a look at devcon:

https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon
Title: Re: Is there a way to get USB device information that's in windows "device manager"
Post by: bpaddock on July 26, 2019, 01:18:40 pm
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.
Title: Re: Is there a way to get USB device information that's in windows "device manager"
Post by: rebar on July 26, 2019, 06:52:29 pm
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