procedure TForm1.Button1Click(Sender: TObject); var ss:Tsearchrec; filepath:string; begin filepath:=Edit1.Text; listbox1.Items.Clear; if findfirst(filepath+'*.*',faAnyFile,ss)=0 then begin if not ((ss.Attr and fadirectory)=fadirectory) then listbox1.Items.Add(ss.Name); while findnext(ss)=0 do begin if not ((ss.attr and fadirectory)=fadirectory) then listbox1.Items.Add(ss.Name); end; findclose(ss); end;