den Ordner durchgehen und wenn searchrec.Attr and FILE_ATTRIBUTE_DIRECTORY = 0 dann in einer variable zusammenzählen
edit:
Delphi-Quellcode:
function GetFolderSize(Path: string): string;
var
f: TSearchRec;
tmp: Int64;
const
sFormat = '%.2n MB';
begin
tmp := 0;
Path := IncludeTrailingPathDelimiter(Path);
if DirectoryExists(path) then
begin
FindFirst(Path + '*.*', faAnyFile, f);
repeat
if (f.Attr and FILE_ATTRIBUTE_DIRECTORY = 0) then
tmp := tmp + f.Size;
until FindNext(f) <> 0;
FindClose(f);
end;
Result := Format(sFormat, [(tmp / 1024) / 1024]);
end;