LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default write usb flash drive information in to excel cell

Look into working with WMI using the "\root\CIMV2" namespace. The info
you want is available but requires running queries in several WMI
classes so that you're sure you're polling the correct USB device...

Win32_LogicalDisk
Query this class filtering only USB drives via
DriveType = "1" (RemoveableDisk).
Make sure you check its ID matches its drive letter (Path).
Note that the device.ID is its system descriptor (drive assigned
when it got plugged in)

Win32_DiskDrive
Query this class for its ".PNPDeviceID" and its ".Size".
The PnpDeviceID for my Kingston DataTraveler stick returns as...

"USBSTOR\DISK&VEN_KINGSTON&PROD_DATATRAVELER_2.0&R EV_PMAP\5B8805000088&0"
The Size for this drive returns as "8003197440"

...which gives you lots of info to work with from just 2 values.

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
when I put my flash drive in, the computer does not give me drive capricorngirlone New Users to Excel 3 April 19th 09 01:51 PM
How do I copy excel file to a flash drive? Bill Excel Discussion (Misc queries) 1 July 3rd 08 03:42 PM
Can I save to hard drive AND my flash drive at the same time? Gizelle Excel Discussion (Misc queries) 3 July 24th 06 08:27 PM
How do I use flash drive in Excel.(selected drive is not in use) Douglas123toexcel Excel Discussion (Misc queries) 2 June 23rd 05 11:52 PM
Pasting a range of information from a foler on F Drive to another folder on same drive Tom Ogilvy Excel Programming 1 August 3rd 03 01:50 AM


All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"