I want scan all available drive letter that exist on my computer, and get detail with it (chk if occupied, chk for type and size).
I have no problem about how to get size by using the codes bellow
var
FreeAvail, totalSpace: Int64;
begin
if SysUtils.GetDiskFreeSpaceEx(PChar('F:\'), FreeAvail, totalSpace, nil) = True
then
begin
F1.Liner('Drive F total space ');
F1.pBold(IntToStr(totalSpace div (1024 * 1024 * 1024)) + ' GB ,');
F1.Liner(' available free space ');
F1.pBold(IntToStr(FreeAvail div (1024 * 1024 * 1024)) + ' GB.');
end;
end;
But if the drive is unoccupied, i don't like this situation.
Question: How to get available ALL drive(s) - CDROM, USB Stick, etc. To be more specific, i want the display result like this example;
Drive E [Local Disk] - TotalSpace 500 GB - FreeSpace 200 GB
Drive F [CD Drive] - Unoccupied - FreeSpace 0
Drive G [Removable] - TotalSpace 8 GB - FreeSpace 2 GB
GetVolumeInformation
andGetDriveType
help you? – Intransigent