procedure TForm1.Button1Click(Sender: TObject);
Var
iFound : Integer;
Path: string;
Attr: Integer;
F: TSearchRec;
begin
Path := 'C:/';
iFound := FindFirst(Path + '*.txt', 0, F);
While (iFound=0) Do
Begin
DeleteFile(Path + F.Name);
Memo1.Lines.Add(F.Name);
iFound := FindNext(F);
End;
end;