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/
- [DUG]: Deletefile('D:\*.*'); Alistair George
- Re: [DUG]: Deletefile('D:\*.*'); Paul Mckenzie
- Re: [DUG]: Deletefile('D:\*.*'); vss
- Re: [DUG]: Deletefile('D:\*.*'); Alister Christie
- Re: [DUG]: Deletefile('D:\*.*'); Pedrocelli
- Re[2]: [DUG]: Deletefile('D:\*.*'); Alistair George
- RE: [DUG]: Deletefile('D:\*.*'); Conor Boyd
- RE: [DUG]: Deletefile('D:\*.*'); Conor Boyd
- RE: [DUG]: Deletefile('D:\*.*'); Conor Boyd
- RE: [DUG]: Deletefile('D:\*.*'); Jianming Lin (ASL)
- RE: RE: [DUG]: Deletefile('D:\*.*'); Paul Eggleton
- [DUG]: Deletefile('D:\*.*'); bigal
- RE: [DUG]: Deletefile('D:\*.*'); Conor Boyd