Jayz
ISP
- Feb 17, 2002
- 59
I would of thought a simple command like the below would work?
DeleteFile('C:\temp\*.*);
DeleteFile('C:\temp\*.*);
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
procedure deleteallfiles(dir : string);
var sl : tstringlist;
sr : tsearchrec;
i,mx : integer;
begin
sl := tstringlist.create;
try
sl.clear;
if findfirst(dir+'*.*',faanyfile,sr) = 0
then begin
repeat
sl.add(sr.name);
until findnext(sr) <> 0;
findclose(sr);
end;
if messagedlg('About to delete '
+inttostr(sl.count)
+' files. Continue?,
mtconfirmation,
[mbyes,mbno],0) = mryes
then begin
mx := sl.count - 1;
for i := 0 to mx
do deletefile(sl[i]);
end;
finally
sl.free;
end;
end;