Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows USB Device Location

I am looking for the proper WMI Win32 or CIM Class property to find the location of a USB device. In device manager, shown below, the Location is known as "Port_#0002.Hub_#0009". Any ideas on the class and property that this is in the Windows API or if it is an arbitrary value Device Manager gives another property which is more cryptic. If the latter, what is the "more cryptic" class and property?

Image: https://i.sstatic.net/7Miwp.png

like image 870
user2588050 Avatar asked Feb 05 '26 20:02

user2588050


1 Answers

Use API SetupDiGetDeviceRegistryProperty and const parameter SPDRP_LOCATION_INFORMATION.

like image 152
DS. Avatar answered Feb 08 '26 15:02

DS.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!