title: List all folders and subfolders in a given structure with filesize
body: <p>I'm trying to list the folderstructure of a disc and each folders size.</p>
  
  <p>I've got the folderstructure down, now i just need to output each folders size. </p>
  
  <p>According to <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/dir" rel="noreferrer">https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/dir</a> there is no flag for displaying filesize - only hiding it. I'm guessing i've gone the wrong route here, but any help is appreciated. </p>
  
  <p>This is what i've got so far:</p>
  
  <p><code>dir /s /b /o:n /a:d &gt; "C:\folderlist.txt"</code></p>
  
  <p>Expected output:</p>
  
  <pre><code>C:\WINDOWS\system32\downlevel 400mb
  C:\WINDOWS\system32\drivers 100mb
  C:\WINDOWS\system32\DriverState 4kb
  C:\WINDOWS\system32\DriverStore 1kb
  C:\WINDOWS\system32\DRVSTORE 1gb
  </code></pre>
  
  <p>The acronym for the filesize i.e. (mb, kb, gb, tb) doesn't matter. As long as it shows the foldersize in some quantifiable manner.</p>
  
  <p>Powershell alternative is also welcome. </p>