apagar varios arquivos

Delphi

05/07/2004

como procedo para excluir varios arquivos de uma só vez com os caracteres curinga *.*


Ale.riopreto

Ale.riopreto

Curtidas 0

Melhor post

Reginaldo174

Reginaldo174

05/07/2004

procedure TForm1.Button2Click(Sender: TObject);
var
SR: TSearchRec;
I: integer;
begin
I := FindFirst(´c:\Delphi\*.*´, faAnyFile, SR);
while I = 0 do begin if (SR.Attr and faDirectory) <> faDirectory then
if not DeleteFile(´c:\Delphi\´ + SR.Name) then ShowMessage(´Não foi possível excluir c:\Delphi\´ + SR.Name);
I := FindNext(SR);
end;
end;

// Os arquivos excluídos com esta rotina não vão para a lixeira!


GOSTEI 1
POSTAR