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 8766727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:37:29+00:00 2026-06-13T16:37:29+00:00

I am using WMI to determine when various forms of media are plugged/put in

  • 0

I am using WMI to determine when various forms of media are plugged/put in (USB drives, CDs, etc). However, encrypted drives such as ‘SanDisk Enterprise FIPS USB’ do something funky: it looks like they represent themselves as a CD drive from which an unlocking application can be launched. When the unlocking utility is finished, the new USB logical disk is available for read/write. So the order of events as I am seeing them from WMI is:

  1. USB is inserted
  2. Win32_DiskDrive object is created (see \.\PHYSICALDRIVE2 below)
  3. distinct Win32_LogicalDisks are created, one I copied below (G:), and holds the launcher, the other (M:, in my case) is the drive that will eventually be accessable.

BUT, no Win32_DiskDriveToDiskPartition entries exist until after the utility has run, which is the usual way to locate volumes from a hardware ID. After much googleing and some trial and error, I haven’t been able to find an architecturally sound method of associating PHYSICALDRIVE2 to G:. The general consensus online is that you shouldn’t expect such mappings to exist, because physical media need not have partitions or volumes, etc, but in my case I basically know it does exist, and would error out in some meaningful way if the expected mapping were missing.

At this point, my only strategy is to enumerate all the volumes and just look for the appropriate file in all CD drives, maybe keeping track of any such devices that have been recognized after my encrypted USB drive was connected. Obviously this is an ugly hack. Suggestions?

TargetInstance = 
instance of Win32_LogicalDisk
{
    Caption = "G:";
    CreationClassName = "Win32_LogicalDisk";
    Description = "CD-ROM Disc";
    DeviceID = "G:";
    DriveType = 5;
    MediaType = 11;
    Name = "G:";
    SystemCreationClassName = "Win32_ComputerSystem";
};

instance of Win32_DiskDrive
{
    Caption = "SanDisk Enterprise FIPS USB Device";
    ConfigManagerErrorCode = 0;
    ConfigManagerUserConfig = FALSE;
    CreationClassName = "Win32_DiskDrive";
    Description = "Disk drive";
    DeviceID = "\\\\.\\PHYSICALDRIVE2";
    FirmwareRevision = "6.61";
    Index = 2;
    InterfaceType = "USB";
    Manufacturer = "(Standard disk drives)";
    MediaLoaded = TRUE;
    Model = "SanDisk Enterprise FIPS USB Device";
    Name = "\\\\.\\PHYSICALDRIVE2";
    Partitions = 0;
    SerialNumber = "u";
    Signature = 0;
    Status = "OK";
    SystemCreationClassName = "Win32_ComputerSystem";
};
  • 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. Editorial Team
    Editorial Team
    2026-06-13T16:37:30+00:00Added an answer on June 13, 2026 at 4:37 pm

    I had a USB 3G dongle that worked in a similar way.

    It presented itself to the computer as two entirely separate devices: a CD-ROM drive and a 3G dongle. In your case it’s a CD-ROM drive and a hard drive.

    Windows thinks G: is actually a physical CD-ROM drive. G: isn’t a partition of PHYSICALDISK2.

    This is why you can’t find a direct connection between G: and PHYSICALDISK2: there isn’t one.

    If you dig deep enough you could show that the CD-ROM and the disk are on the same USB bus. I don’t know if you could conclusively demonstrate via software that they are actually the same device.

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

Sidebar

Related Questions

Is there anyway using WMI/.Net to grab monitor information such as Manufacturer, Serial Number,
I'm using WMI to retrieve information about physical drives on the system: SELECT *
SOLVED I am using delphi 2009. My program listens for usb drives being connected
Rather than using WMI to obtain the last boot time, I wanted to calculate
I'm using WMI in .NET to connect to remote machines in a web app.
I'm experiencing a memory leak when using WMI from Delphi 7 to query a
Im trying to get some system information using WMI but the problem is when
Is there a way to get Windows audio mixer levels using WMI? For example,
I need to start a Visual Basic script file by using WMI in a
I have a C# exe that needs to be run using WMI and access

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.