April 20th, 2006, 05:48 AM
Parsing an extended partition for logical partitions
I'm working on an application to print out informations
for all partitions on a HD.
I'm using VisualStudio 2003 on Win2000.
There is one primary partition and one extended partition with
5 logical partitions.
The property "Partitions" of the WMI Class "Win32_DiskDrive"
gives me the right number of partitions -> 6.
Then I'm using the following query for every HD:
QueryString = @"ASSOCIATORS OF Win32_DiskDrive.DeviceID="""+strEscapedDeviceID+
@"""} WHERE AssocClass = Win32_DiskDriveToDiskPartition";
ManagementObjectCollection wmiDiskPartitions = (
new ManagementObjectSearcher(Scope, new ObjectQuery(QueryString),
The Caption property of the result reads:
Disk #0, Partition #0 -> boot partition
Disk #0, Partition #1 -> extended partition
but there are 5 more (logical) partitions (4 with no drive letter assigned
because they are backup partitions but still valid NTFS partitions)
Can someone tell me how to get informations on these partitions
with WMI or P/Invoke
July 2nd, 2009, 08:58 AM
Re: Parsing an extended partition for logical partitions
Have you figured it out? I'm having the same problem.
Click Here to Expand Forum to Full Width