I use Mathematica10 in my Win7 and I want to estimate the amount of disk space occupied by each dirs.
I try the code(the code was copied from How do I find the amount of free space on disk?, actually I don't know how it works at all):
dirsofD = FileNames["*", "D:\\"]
and
sizeoddirsofD =
ToExpression@
StringJoin[
ReadList["!dir " <> #, Word, RecordLists -> True,
WordSeparators -> {" ", ","}][[-2, 3 ;; -2]]] & /@ dirsofD
However, the code above only count the files directive under certain dir while the files under subdirs of given dir are missed, which means the search depth is only one. How could I get the whole size of all files of certain dir?