FindFirst

22:52
procedure TForm1.Button1Click(Sender: TObject);
var
SRec: TSearchRec;
begin
if FindFirst('C:\Windows\*.txt', SysUtils.faAnyFile, SRec) = 0 then
repeat
if (sRec.Name = '.') or (sRec.Name = '..') then
Continue;
if (srec.Attr and sysutils.faDirectory) = 0 then begin
Memo1.Lines.Add(srec.Name);
end;
until FindNext(SRec) <> 0;
end;