Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Sat, 5 Jul 2008 09:07:25 -0700 (PDT),    group: microsoft.public.win32.programmer.wmi        back       


Identify USB drive uniquely   
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
date: Sat, 5 Jul 2008 09:07:25 -0700 (PDT)   author:   D2

Re: Identify USB drive uniquely   
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
date: Mon, 7 Jul 2008 14:05:10 -0500   author:   Allan

Re: Identify USB drive uniquely   
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
date: Fri, 11 Jul 2008 08:56:00 -0700 (PDT)   author:   Dominic Johnson

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us