USB PNP
-
How can I search for a USB PNP ID? For example, when you run "msinfo32.exe" and then expand "Components/USB", it lists all the USB devices as well as their "PNP Device ID". I tried using This Code[^]; however, it doesn't list my USB device, although it does work properly by detecting the mouse and some other devices. One thing I noticed is that all the devices that the code above finds start with "HID" in the msinfo32.exe "PNP Device ID"; however, my device starts with USB. My device id is: USB\VID_0403&PID_6001. -- modified at 20:26 Saturday 13th May, 2006
-
How can I search for a USB PNP ID? For example, when you run "msinfo32.exe" and then expand "Components/USB", it lists all the USB devices as well as their "PNP Device ID". I tried using This Code[^]; however, it doesn't list my USB device, although it does work properly by detecting the mouse and some other devices. One thing I noticed is that all the devices that the code above finds start with "HID" in the msinfo32.exe "PNP Device ID"; however, my device starts with USB. My device id is: USB\VID_0403&PID_6001. -- modified at 20:26 Saturday 13th May, 2006
I figured it out by using
ManagementObjectSearcher
class. Wow! This class is really powerful if you ever need to figure out anything from your hardware. Here is the code:string device = "Win32_USBHub"; ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from " + device); foreach(ManagementObject mo in searcher.Get()) { Trace.WriteLine(mo.GetPropertyValue("Name")+" "+ mo.GetPropertyValue("PNPDeviceID")); }
Note that there are a ton of hardware classes available from here[^]. Each class has several variables that can be accessed using theGetPropertyValue
method.