Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
A physical disk drive is the cornerstone of any storage management system. However, after a physical disk drive has been installed, neither users nor system administrators typically deal with the hardware directly. Instead, both users and system administrators interact with the logical drives that have been created on the disk.
A logical drive is a subdivision of a partition that has been assigned its own drive letter. (It is possible to have a partition that has not been assigned a drive letter.) When you talk about drive C or drive D, you are referring to a logical drive rather than to a physical disk drive. Likewise, when you save a document to drive E, you are saving it to the logical drive. Physical disks compose the hardware that makes up a drive, including such components as heads, sectors, and cylinders. Logical drives, by contrast, have properties such as disk space, available disk space, and drive letters.
The properties of a logical drive can be retrieved using the Win32_LogicalDisk class. A subset of properties available through this class is shown in Table 10.3.
Note
Table 10.3 Win32_LogicalDisk Properties
Property | Description |
---|---|
Compressed | Indicates whether the logical volume exists as a single compressed entity, such as a DoubleSpace volume. If file-based compression is supported (such as on NTFS), this property is False. |
DeviceID | Unique identifier of the logical disk from other devices on the system. |
DriveType | Numeric value corresponding to the type of disk drive this logical disk represents. Values are: 0 Unknown 1 No Root Directory 2 Removable Disk 3 Local Disk 4 Network Drive 5 Compact Disc 6 RAM Disk |
FileSystem | File system on the logical disk. |
FreeSpace | Space available on the logical disk. |
MaximumComponentLength | Maximum length of a file name component (the portion of a file name between backslashes) supported by the Win32 drive. The value can indicate that long names are supported by the specified file system. |
MediaType | Type of media currently present in the logical drive. The value might not be exact for removable drives if there is no media currently in the drive. Values include (but are not limited to): 0 Format is unknown 1 5.25-inch floppy disk (1.2Mb, 512 bytes/sector) 2 3.5-inch floppy disk (1.44Mb, 512 bytes/sector) 3 3.5-inch floppy disk (2.88Mb, 512 bytes/sector) 4 3.5-inch floppy disk (20.8Mb, 512 bytes/sector) 11 Removable media other than floppy 12 Fixed hard disk media 20 3.5-inch floppy disk (128Mb, 512 bytes/sector) 21 3.5-inch floppy disk (230Mb, 512 bytes/sector) |
Name | Label by which the object is known. |
Size | Size of the disk drive. |
SupportsFileBasedCompression | Indicates whether the logical disk partition supports file-based compression, such as is the case with NTFS. This property is False when the Compressed property is True. |
SystemName | Name of the computer where the drive is installed. |
VolumeName | Volume name of the logical disk. (Maximum 32 characters.) |
VolumeSerialNumber | Volume serial number of the logical disk. (Maximum 11 characters.) |
Listing 10.3 contains a script that enumerates the properties of all the logical disk drives on a computer. To carry out this task, the script must perform the following steps:
This query returns a collection consisting of all the logical disk drives installed on the computer.
Listing 10.3 Enumerating Logical Disk Drive Properties
|
|
Send us your feedback | « Previous | Next » |