Ich will mal nicht so sein.
So könnte es gehen (ungetestet):
Delphi-Quellcode:
procedure FindAllFolders(RootFolder: string; Mask: string = '*.*'; Recurse: Boolean = True);
var
SR: TSearchRec;
begin
if AnsiLastChar(RootFolder)^ <> '\' then
RootFolder := RootFolder + '\';
if Recurse then
if FindFirst(RootFolder + '*.*', faAnyFile, SR) = 0 then
try
repeat
if SR.Attr and faDirectory = faDirectory then
if (SR.Name <> '.') and (SR.Name <> '..') then
begin
FindAllFolders(RootFolder + SR.Name, Mask, Recurse);
Form1.Memo1.Lines.Add(RootFolder);
end;
until FindNext(SR) <> 0;
finally
FindClose(SR);
end;
end;