procedure DeleteFiles (const Path, Mask : string; recursive : boolean);
var
Result : integer;
SearchRec : TSearchRec;
begin
Result := FindFirst(Path + Mask, faAnyFile - faDirectory, SearchRec);
while Result = 0 do begin
if not DeleteFile (Path + SearchRec.name) then begin
FileSetAttr (Path + SearchRec.name, 0); { reset all flags }
DeleteFile (Path + SearchRec.name);
end;
Result := FindNext(SearchRec);
end;
FindClose(SearchRec);
end;
var
Result : integer;
SearchRec : TSearchRec;
begin
Result := FindFirst(Path + Mask, faAnyFile - faDirectory, SearchRec);
while Result = 0 do begin
if not DeleteFile (Path + SearchRec.name) then begin
FileSetAttr (Path + SearchRec.name, 0); { reset all flags }
DeleteFile (Path + SearchRec.name);
end;
Result := FindNext(SearchRec);
end;
FindClose(SearchRec);
end;
이렇게 하시면 되여....
실은 저도 어디선가에서 펀것이지만....^^;