Win32_DiskDriveToDiskPartition class
Applies to: desktop apps only
The Win32_DiskDriveToDiskPartition association WMI class relates a disk drive and a partition existing on it.
The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties are listed in alphabetic order, not MOF order.
Syntax
class Win32_DiskDriveToDiskPartition : CIM_MediaPresent
{
Win32_DiskDrive REF Antecedent;
Win32_DiskPartition REF Dependent;
};
Members
The Win32_DiskDriveToDiskPartition class has these types of members:
Properties
The Win32_DiskDriveToDiskPartition class has these properties.
- Antecedent
-
- Data type: Win32_DiskDrive
- Access type: Read-only
- Qualifiers: Key
Reference to the instance representing the properties of the disk drive where the partition exists.
- Dependent
-
- Data type: Win32_DiskPartition
- Access type: Read-only
- Qualifiers: Key
Reference to the instance representing the disk partition residing on the disk drive.
Remarks
The Win32_DiskDriveToDiskPartition class is derived from CIM_MediaPresent.
Examples
For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
For C++ code examples, see WMI C++ Application Examples.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Namespace |
\root\CIMV2 |
|
MOF |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 3/9/2012
# Get-DiskDriveToDiskPartition
# Sample showing Win32_DiskDriveToPartition class
# Thomas Lee - tfl@psp.co.uk
# First, display Win32DiskDriveToDiskPartition class
# Only show two key properties
"Win32_DiskDriveToDiskPartition"
Get-WmiObject
Win32_DiskDriveToDiskPartition|flAntecedent, Dependent# Show the other related classes
# First Win32_DiskDrive
""
;"Win32_DiskDrive"Get-WmiObject
Win32_DiskDrive|ft-autosize# And now related Disk Partitions
""
;"Win32_DiskPartition"Get-WmiObject
Win32_DiskPartition|sortname
This script produces the following output:
PS C:\foo> .\Get-Win32DiskDriveToDiskPartition.ps1
Win32_DiskDriveToDiskPartition
Antecedent : \\COOKHAM8\root\cimv2:Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE5"
Dependent : \\COOKHAM8\root\cimv2:Win32_DiskPartition.DeviceID="Disk #5, Partition #0"
Antecedent : \\COOKHAM8\root\cimv2:Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE0"
Dependent : \\COOKHAM8\root\cimv2:Win32_DiskPartition.DeviceID="Disk #0, Partition #0"
Antecedent : \\COOKHAM8\root\cimv2:Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE0"
Dependent : \\COOKHAM8\root\cimv2:Win32_DiskPartition.DeviceID="Disk #0, Partition #1"
Antecedent : \\COOKHAM8\root\cimv2:Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE0"
Dependent : \\COOKHAM8\root\cimv2:Win32_DiskPartition.DeviceID="Disk #0, Partition #2"
Antecedent : \\COOKHAM8\root\cimv2:Win32_DiskDrive.DeviceID="\\\\.\\PHYSICALDRIVE0"
Dependent : \\COOKHAM8\root\cimv2:Win32_DiskPartition.DeviceID="Disk #0, Partition #3"
Win32_DiskDrive
Partitions DeviceID Model Size Caption
---------- -------- ----- ---- -------
1 \\.\PHYSICALDRIVE5 WD My Book IEEE 1394 SBP2 Device 2000388096000 WD My Book IEEE 1394 SBP2 Device
4 \\.\PHYSICALDRIVE0 ATA Hitachi HDS72107 SCSI Disk Device 750153761280 ATA Hitachi HDS72107 SCSI Disk Device
0 \\.\PHYSICALDRIVE1 TEAC USB HS-CF Card USB Device TEAC USB HS-CF Card USB Device
0 \\.\PHYSICALDRIVE3 TEAC USB HS-MS Card USB Device TEAC USB HS-MS Card USB Device
0 \\.\PHYSICALDRIVE4 TEAC USB HS-SD Card USB Device TEAC USB HS-SD Card USB Device
0 \\.\PHYSICALDRIVE2 TEAC USB HS-xD/SM USB Device TEAC USB HS-xD/SM USB Device
Win32_DiskPartition
NumberOfBlocks : 144522
BootPartition : False
Name : Disk #0, Partition #0
PrimaryPartition : True
Size : 73995264
Index : 0
NumberOfBlocks : 4209030
BootPartition : True
Name : Disk #0, Partition #1
PrimaryPartition : True
Size : 2155023360
Index : 1
NumberOfBlocks : 102400000
BootPartition : False
Name : Disk #0, Partition #2
PrimaryPartition : True
Size : 52428800000
Index : 2
NumberOfBlocks : 1358391296
BootPartition : False
Name : Disk #0, Partition #3
PrimaryPartition : False
Size : 695496343552
Index : 3
NumberOfBlocks : 3907012608
BootPartition : False
Name : Disk #5, Partition #0
PrimaryPartition : True
Size : 2000390455296
Index : 0
- 11/22/2008
- Thomas Lee
- 11/22/2008
- Thomas Lee