Delphi-Quellcode:
function FolderSize(FolderName: string): Int64;
var
fldr, fso: OleVariant;
begin
fso := CreateOleObject('Scripting.FileSystemObject');
fldr := fso.GetFolder(FolderName);
result := fldr.size;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(IntToStr(FolderSize('C:\Windows')));
end;
Kompilieret ohne Probleme. Allerdings bekomme ich bei
result eine Acception.