Ok, jetzt gehts. Vielen Dank
Delphi-Quellcode:
procedure DeleteEmptyDirectories(Path: String);
var
SearchRec: TSearchRec;
begin
if FindFirst(IncludeTrailingPathDelimiter(Path) + '*.*', faAnyFile, SearchRec) = 0 then
begin
repeat
if ((SearchRec.Attr and faDirectory) = faDirectory) and (SearchRec.Name <> '..') and (SearchRec.Name <> '.') then
DeleteEmptyDirectories(IncludeTrailingPathDelimiter(Path) + SearchRec.Name);
until (FindNext(SearchRec) <> 0);
FindClose(SearchRec);
end;
RemoveDir(Path);
end;