Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 168549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:28:23+00:00 2026-05-11T12:28:23+00:00

I have several USB drives connected to a WinXP SP3 computer, and I need

  • 0

I have several USB drives connected to a WinXP SP3 computer, and I need to tell them apart programatically – I need to find which drive letter corresponds to which device (in this case, one device ~ one volume). I can get their Volume IDs and drive letters using mountvol, looking something like this:

C:\WINDOWS\> mountvol \\?\Volume{bdb681b2-1ddf-11dd-bf71-806d6172696f}\     C:\  \\?\Volume{6a8784f8-7406-11dd-a8c3-001e8c829b67}\     A:\ 

Also, using devcon or the Device Manager, I can see the device IDs:

C:\WINDOWS\> devcon resources *STOR* STORAGE\REMOVABLEMEDIA\7&190C24E5&0&RM     Name: Generic volume STORAGE\VOLUME\1&30A96598&0&SIGNATURED84ED84EOFFSET7E00LENGTH2543150400     Name: Generic volume USBSTOR\DISK&VEN_KINGSTON&PROD_DATATRAVELER2.0&REV_1.00\0803240752536&0     Name: Kingston DataTraveler2.0 USB Device 

However, I haven’t found a way to link the device ID and the volume ID/letter, like the ‘Safely remove hardware’ dialog does (therefore I assume it’s possible):

Generic volume - A:
(source: piskvor.org)

As you may see, these are the same devices that I see in devcon and the same volume that mountvol sees; but so far I haven’t found the link between them.

I’ve found some related questions, but those seem to use the approach ‘whatever you find first is your USB device’, which is not very useful in my case, since there will be several similar devices (same vendor, often same product type) connected.


Edit:

@MSalters‘ answer looks promising: On XP, HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices has REG_BINARY values \DosDevices\x: (where x is [A-Z]); the comment is (UTF-16) name of the correct device (e.g.
\DosDevices\A: = ‘\??\STORAGE#RemovableMedia#7&190c24e5&0&RM#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}\', which corresponds to
STORAGE\REMOVABLEMEDIA\7&190C24E5&0&RM seen above in the device list).

Will see if that’s the way to go.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:28:24+00:00Added an answer on May 11, 2026 at 12:28 pm

    It’s a non-trivial question. There is no official API for it, as far as I can tell. So, you need an undocumented API: the registry. HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices contains entries for both drive letters and volume IDs. If you look at the actual data, you’ll find that it identifies the drive. Look at the binary data as a Unicode string. It will point you to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ENUM\. However, XP and Vista differ in exactly what subkeys are referenced there, and how. (Vista is easier, so try that first).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several long lists in python and have compare them and find the
I have several drivers using a resource in my code, of which only one
I have several apps that need to create and write to Performance Counters. One
I've turned on USB debugging. I have the latest HTC Sync and android SDK
I have an application (video stream capture) which constantly writes its data to a
I have several web services. One of this services is used for retrieve a
I have several variables of type char (array), int, and double. Is there a
I seem to be in need of some help (and by some, I mean
Preliminary story There is this program which uses the Parallel Port to synchronize with
I am planning on doing a small arduino project and would like to know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.