Holas! Mira, para lo que vos necesitas va perfecto una funcion recursiva...
Por ejemplo aslgo como esto:
Código Delphi
[-]
var dirs: TStringList;
...
...
procedure GetDirList(path: string);
var sr: TSearchRec;
begin
if FindFirst(path+'\*.*', faDirectory, sr)=0 then begin
while FindNext(sr)=0 do
if ((sr.Attr and faDirectory)<>0) and (sr.Name<>'.') and (sr.Name<>'..') then begin
dirs.Add(path+'\'+sr.Name);
GetDirList(path+'\'+sr.Name);
end;
FindClose(sr);
end;
end;
la variable dirs debe estar inicializada antes de llamar a la funcion.