procedure DelFiles (f:string );
var
  SearchRec: TSearchRec;
begin 
  ChDir (ExtractFilePath (f));   // Enter the file path
  FindFirst (f, faAnyFile, SearchRec);
  repeat
    if FileExists (SearchRec.Name)then
    begin
       //FileSetAttr(SearchRec.Name,0); // Modify file attributes to ordinary attribute values
      DeleteFile (SearchRec.Name); // Delete file
    end ;
  until (FindNext (SearchRec) <>0);
  FindClose (SearchRec);
end ;