Reputation: 51
i am building an Adobe Air App where i can only fetch the "drive letter" of the particular usb thumb drive i am plugging in.
This drive can be easily also fetched with wmic logicaldisk where 'DeviceId="D:"'
if drive letter is D:
But what i really want is to get the PNPDeviceID of Win32_DiskDrive class for the drive mentioned before.
As far as i can think , linking win32_logicaldisk and win32_diskdrive with some class in between would do the trick , yet i can't figure the way for it.
So i kindly request to put your expertise forward on this thread to solve this problem.
cheers
SJ
Upvotes: 2
Views: 4480
Reputation: 51
Found the Answer from here http://forum.exetools.com/showthread.php?t=11226
WMIC PATH WIN32_DISKPARTITION ASSOC <-- this command links win32_logicaldisk with win32_diskdrive in a weird but manageable way.
thanks for your help guys !
Upvotes: 3
Reputation: 490438
I believe you need two different WMI classes to derive this. First, Win32_LogicalDiskToPartition
, to (obviously enough) map the logical disk to a partition. Then you can use Win32_DiskDriveToDiskPartition
to find the physical drive holding that partition.
Upvotes: 4