Try

Procedure DeleteAllFilesInDirectory(const dir : string);
var
FileSpec : string;
SearchRec : TSearchRec;
begin
if DirectoryExists(Dir) then
begin
FileSpec := IncludeTrailingBackSlash(Dir) + '*.*';
if FindFirst(FileSpec, faAnyFile, SearchRec) = 0 then
begin
repeat
DeleteFile(IncludeTrailingBackSlash(Dir) + SearchRec.Name);
until FindNext(SearchRec) <> 0;
end;
FindClose(SearchRec);
end;
end;

Alister

---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to