title: getting count of folders inside specified directory(subdirectories too included)
body: <p>I have procedure which gives me folders  of current directory only.How to get all folders in  subdirectories also(all the folders present in current directory + all the folders present in subdirectorie) Thanks in advance</p>
  
  <pre><code>procedure GetSubDirectories(const directory : string; list : TStrings) ;
  var
   sr : TSearchRec; 
  begin  
   try     
    if FindFirst(IncludeTrailingPathDelimiter(directory) + '*.*', faDirectory, sr) &lt; 0 then
     Exit
    else
    repeat
    if ((sr.Attr and faDirectory &lt;&gt; 0) AND (sr.Name &lt;&gt; '.') AND (sr.Name &lt;&gt; '..')) then
     List.Add(IncludeTrailingPathDelimiter(directory) + sr.Name) ;
    until
     FindNext(sr) &lt;&gt; 0;
    finally
     SysUtils.FindClose(sr) ;
    end;
  end;
  </code></pre>