Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. USB drive letter from WMI

USB drive letter from WMI

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Subrat Patnaik
    wrote on last edited by
    #1

    hi all, i am using a function to retrieve the drive letter of a USB drive from WMI with the deviceID i have with me, as it is with the specific deviceID and the corresponding drive letter, i create a file to monitor activities on the USB. the deviceID which i have with me is in the format "USB\\VID_0980&PID_762A\\..." which i retrieve at the moment a USB drive is inserted. in my function i take this deviceID as input and map the drive letter corresponding to it. as i have looked upon and subsequently found out that the mapping of drive letter in WMI has been done by taking the deviceID in the format "USBSTOR\\DISK&Ven_TOSHIBA&PROD_TRA........". the DeviceID "USBSTOR\\DISK&Ven_TOSHIBA&PROD_TRA......." can be achieved from WIN32_PnpEntity.DeviceID and also from WIN32_USBControllerDevice.Dependent the DeviceID "USB\\VID_0980&PID_762A\\..." can be retrieved from WIN32_PnpEntity.DeviceID and also from WIN32_USBControllerDevice.Dependent. although both these deviceID are from the same USB device the mapping for drive letter is done thorugh the previous one i.e "USBSTOR\\DISK&Ven_TOSHIBA&PROD_TRA......." and i am not getting a link between these two DeviceIDs. so please can i get some help on how to retrieve the drive letter of USB device using the device ID "USB\\VID_0980&PID_762A\\..." Thank You.

    L 1 Reply Last reply
    0
    • S Subrat Patnaik

      hi all, i am using a function to retrieve the drive letter of a USB drive from WMI with the deviceID i have with me, as it is with the specific deviceID and the corresponding drive letter, i create a file to monitor activities on the USB. the deviceID which i have with me is in the format "USB\\VID_0980&PID_762A\\..." which i retrieve at the moment a USB drive is inserted. in my function i take this deviceID as input and map the drive letter corresponding to it. as i have looked upon and subsequently found out that the mapping of drive letter in WMI has been done by taking the deviceID in the format "USBSTOR\\DISK&Ven_TOSHIBA&PROD_TRA........". the DeviceID "USBSTOR\\DISK&Ven_TOSHIBA&PROD_TRA......." can be achieved from WIN32_PnpEntity.DeviceID and also from WIN32_USBControllerDevice.Dependent the DeviceID "USB\\VID_0980&PID_762A\\..." can be retrieved from WIN32_PnpEntity.DeviceID and also from WIN32_USBControllerDevice.Dependent. although both these deviceID are from the same USB device the mapping for drive letter is done thorugh the previous one i.e "USBSTOR\\DISK&Ven_TOSHIBA&PROD_TRA......." and i am not getting a link between these two DeviceIDs. so please can i get some help on how to retrieve the drive letter of USB device using the device ID "USB\\VID_0980&PID_762A\\..." Thank You.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi, i´ve the same problem at the moment. Did you find a solution yet?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups