Hi, I need to identify all connected usb drives uniquely. when a usb drive (pen drive or external usb hard disk) is connected, i intend to identify it uniquely and store it somewhere. Next time when this same drive is plugged again, i intend to use the stored identification info to identify the drive. any pointers in this regard would be grately appreciated. thanks, d2
If you are just looking for information about disk then you can query Win32_DiskDrive. You will be able to determine specifics like Caption will be the drive model and DeviceID will be able to determine which drive is which if you have to that are the same model. Thanks Allan "D2" wrote in message news:071aa2ad-c7d8-4125-96d1-32a37d80e1d7@y38g2000hsy.googlegroups.com... > Hi, > > I need to identify all connected usb drives uniquely. when a usb drive > (pen drive or external usb hard disk) is connected, i intend to > identify it uniquely and store it somewhere. Next time when this same > drive is plugged again, i intend to use the stored identification info > to identify the drive. > > any pointers in this regard would be grately appreciated. > > thanks, > d2
It can be difficult to identify a USB pen drive from Win32_DiskDrive. The Win32_PnPEntity class property DeviceID may be better and in my limited test USB pen drives of the same make and model have a different DeviceID. It may be unique but I can't say for sure - you would have to test this. Win32_DiskDrive might be useful for identifying when a pen drive or disk are attached to the system. There will be an Instance Creation Event for the disk and the Win32_DiskDrive will have an association with a Win32_PnPEntity so you could register for the creation event and this could lead you to identifying the new disk as a USB device and possibly getting some uniquely identifiable information about it.. Alternatively you could look for the creation event of the Win32_PnPEntity and check for an association with Win32_DiskDrive. You might also be able to link the device to the user through associators if this is also information you are interested in collecting. Dominic