Click to See Complete Forum and Search --> : WM_DEVICECHANGE, and getting Model


QBasicer
June 9th, 2005, 03:13 PM
Hello, I'm currently trying to program myself something that's like an autorun for USB (because USB doesn't support autolaunching).

Here's my problem:
When I attach a device, I can get WM_DEVICECHANGE, and the drive number etc.

What I want to do, is based of this information, is find out the Model of the device, something I can do with WMI if I just scan the system, like so:
Physical Drive is REMOVEABLE
Connected to ROOT\CIMV2 WMI namespace
Enumerating Devices
Model : WDC WD1200AB-22CBA1
Model : WDC WD200EB-00BHF0
Model : LEXAR JUMPDRIVE USB Device
Press any key to continue
As you can tell, the last item, LEXAR JUMPDRIVE USB Device, is my USB thumbdrive. My question is, how can I get this model information when the device is plugged in?

Thanks!