procedure FindExeFromPath(aPath: string; aMemo: TMemo);<br>var<br> sr: TSearchRec;<br>begin<br> if FindFirst(aPath, faAnyFile, sr) = 0 then<br> begin<br> repeat<br> if (sr.Name = '.') or (sr.Name = '..') then<br> Continue;<br> if sr.Attr and faDirectory <> 0 then<br> FindExeFromPath(ExtractFilePath(aPath) + sr.Name + '/*.*', aMemo)<br> else if SameText(ExtractFileExt(sr.Name), '.exe') then<br> aMemo.Lines.Add(ExtractFilePath(aPath) + sr.Name);<br> until FindNext(sr) <> 0;<br> FindClose(sr);<br> end;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> FindExeFromPath('c:/*.*', Memo1);<br>end;