procedure DelFiles(f: string); var SearchRec: TSearchRec; begin ChDir(ExtractFilePath(f)); //进入文件路径 FindFirst(f, faAnyFile, SearchRec); repeat if FileExists(SearchRec.Name) then begin //FileSetAttr(SearchRec.Name,0); //修改文件属性为普通属性值 DeleteFile(SearchRec.Name); //删除文件 end; until(FindNext(SearchRec)<>0); FindClose(SearchRec); end;