procedure DeleteTree(Path: String);<br>var<br> Rec: TSearchRec;<br> Found: Integer;<br>begin<br> Found := FindFirst(Path + '*.*', faAnyFiles, Rec);<br> while Found = 0 do begin<br> if (Rec.Attr and faDirectory <> 0) and (Rec.Name <> '.') and (Rec.Name <> '..') then <br> DeleteTree(Path + Rec.Name + '/')<br> else DeleteFile(Path + Rec.Name);<br> Found := FindNext(Rec);<br> end;<br> FindClose(Rec);<br> RmDir(Copy(Path, 1, Length(Path) - 1));<br>end;