Disk-Properties
To view Disk Properties on Delphi Programms.
- Active · last change 10-21-2025
- ★ 3 on GitHub
README
Disk-Properties:
:


: 
:
:
:
To get disk properties in Delphi, you can use IOUtils's TDirectory.GetLogicalDrives for drive letters or the System.SysUtils.GetDiskFreeSpaceEx function to get details like total size and free space for a given drive letter. For detailed hardware information, you can access the Windows WMI (Windows Management Instrumentation) system, often with the help of the GLibWMI library or a component suite like TMiTeC's storage components.
</nr>
- Get Drive Letters: Use System.IOUtils.TDirectory.GetLogicalDrives to retrieve a list of all available drive letters (e.g., "C:"). You can also use the older WinAPI GetLogicalDriveStrings for compatibility with older Delphi versions.
- Get Free Space and Total Size: Once you have a drive letter, use System.SysUtils.GetDiskFreeSpaceEx(PChar(DriveLetter), UsedSpace, TotalSpace, @FreeSpace) to get the total, free, and used space in bytes for that drive.
Accessing Detailed Disk Properties with WMI
For more in-depth information such as disk type (HDD, SSD), serial number, or media type, you'll need to query the Windows WMI system.
- Using Libraries: The GLibWMI Library is a component library that provides an easy way to access WMI information from Delphi. Embarcadero's blog also showcases the TMiTeC_DeviceMonitor component suite, which can list storage device properties.
- WMI Information to Access: You can query for information like DriveType to distinguish between different drive types (e.g., local fixed, CD-ROM, removable). Details like SpindleSpeed for HDDs or media type for SSDs are available through WMI for more specific hardware properties.

