File size and file count of many directories

I’m making an inventory of the directories in a couple of our servers here. At the root level, I need to determine the file count and total file size of each directory and all subdirectories. Right now I have to right click -> properties on each of the folders to get this information.

Is there a way I can do this with Windows command line tools? If not, is there a program (preferably free) I can download?

Thanks!

WinDirStat. LOVE IT!

Seconded. WinDirStat is a very useful, enlightening, and entertaining program.

TreeSize is another option

Here’s a script I wrote a while back to do exactly that (roughly similar to ‘du’ in unix if you’re familiar). Handy for just finding the top disk hogs with the “–largest <n>” argument. Also has the option to just look at the top directories in the specified target directory. For example:

“measuredir c:\windows --largest 10” produces:



5.04G c:\windows\
946.65M c:\windows\system32\
619.72M c:\windows\$hf_mig$\
567.69M c:\windows\ServicePackFiles\
564.70M c:\windows\ServicePackFiles\i386\
562.88M c:\windows\SoftwareDistribution\
553.41M c:\windows\SoftwareDistribution\Download\
447.00M c:\windows\$NtServicePackUninstall$\
397.00M c:\windows\assembly\
247.09M c:\windows\system32\dllcache\

whereas “measuredir c:\windows --largest 10 --toplevel” only shows the sizes of direct subdirectories of c:\windows:



946.65M c:\windows\system32\
619.72M c:\windows\$hf_mig$\
567.69M c:\windows\ServicePackFiles\
562.88M c:\windows\SoftwareDistribution\
447.00M c:\windows\$NtServicePackUninstall$\
397.00M c:\windows\assembly\
224.99M c:\windows\Microsoft.NET\
203.02M c:\windows\ie7updates\
165.34M c:\windows\Installer\
112.09M c:\windows\Driver Cache\

Doh! I just noticed you wanted the file count in the dirs, too. My script doesn’t do that, but it could be added pretty easily.

Thanks to all.

I also was going to write my own script but I thought I’d ask here first.

I tried the windirstat tool and it works great! thanks for all the suggestions.