0
I am trying to map PHYSICAL Disks to mounted partitions and even further into mounted volume letters (C:\ is mounted on partition 0 of disk 0)
First I'm using
Select * from Win32_DiskDrive
to get the Index for all physical drives. Then I use
SELECT Name FROM Win32_DiskPartition WHERE Index = " & objDiskDrive.Index
The name is something in the form of Disk #0 Partition #0
. Using this I try to run a query against Win32_LogicalDiskToPartition
This returns things like:
Antecedent: \\COMP_NAME\root\cimv2:Win32_DiskPartition.DeviceID="Disk #0, Partition #0"
Dependent: \\COMP_NAME\root\cimv2:Win32_LogicalDisk.DeviceID="C:"
EndingAddress: 160039272959
StartingAddress: 1048576
If I could query against the antecedent string and parse out the dependent string I could get my mapping, but that is not working. The query is invalid. I am trying to run the following:
Select * from Win32_LogicalDiskToPartition WHERE Antecedent LIKE '%Disk #0, Partition #0%'