procedure TForm1.Button1Click(Sender: TObject);
var
f,t: Double;
Drivename: Char;
begin
// Program By S.T.A Group Programming (Saeed System)http://www.delphicode.blogfa.com
// This Program For Get Information From a Partition Disk
Drivename := 'c';
f:= DiskFree(Ord(Drivename) - 64);
t:= DiskSize(Ord(Drivename) - 64);
label1.Caption := Format('فضای خالی: %12.0n', [f]);
Label2.Caption := Format('فضای کل دیسک: %12.0n', [t]);
Label3.Caption := IntToStr(Round((t - f) / t * 100)) +
' درصد از پارتیشن استفاده شده';
end;
با تشکر از http://www.delphicode.blogfa.com/