dir /totalsize

Dec 24, 2008
21
0
#1
How do I do a dir on a directory (including it's subdirs) when all I want returned is the total size of that whole structure.

Thanks,
Jim
 
#3
TEA-Time wrote:
| ---Quote (Originally by jimklein)---
| How do I do a dir on a directory (including it's subdirs) when all I
| want returned is the total size of that whole structure.
| ---End Quote---
| Here's a SysInternals utility for doing just that.
|
| http://technet.microsoft.com/en-us/sysinternals/bb896651.aspx

No need. Look at the /U switch of the DIR command (esp. subcode 2, i.e., DIR
/U2).
--
HTH, Steve
 

dim

Dimitry Andric
May 31, 2008
204
1
Netherlands
#4
On 2009-02-23 18:18, jimklein wrote:

> How do I do a dir on a directory (including it's subdirs) when all I want returned is the total size of that whole structure.
dir /a /s /u2 targetdir

or

echo %@filesize[/s targetdir]
 
Jun 2, 2008
295
1
#7
Ah, I see that if you happen to be looking for an accurate subdirectory count, /h should also be used to keep the "." and ".." directories from being counted.