Dos Command/Batch file to find a folder size

Solved/Closed
trusp Posts 4 Registration date Wednesday 3 December 2008 Status Member Last seen 5 December 2008 - 4 Dec 2008 à 06:41
 Mandarilho - 18 Dec 2012 à 22:26
Hello,
I need a DOS command/Batch file to get the folder size alone.
Example C:\Sample1
Size is :457865

Batch file must be DOS based.

Please help me on this.
Thanks
Related:

5 responses

trusp Posts 4 Registration date Wednesday 3 December 2008 Status Member Last seen 5 December 2008 43
5 Dec 2008 à 04:50
Hi Boris,

Thank you very much for your respond.
I copied this script and executed as you specified. But not got any solution.
The following was been displayed in CLI.
C:\>Test.cmd C:\Sample
'selLocal' is not recognized as an internal or external command,
operable program or batch file.
Missing operator.
Missing operator.
Missing operator
....
Size is: !value!

So I put @echo on and the CLI executed as shown below:
C:\>Test.cmd C:\Sample

C:\>selLocal EnableDelayedExpansion
'selLocal' is not recognized as an internal or external command,
operable program or batch file.

C:\>set /a value=0

C:\>FOR /R C:\Sample %I IN (*) DO set /a value=!value!+%~zI

C:\>set /a value=!value!+3064
Missing operator.

C:\>set /a value=!value!+2672
Missing operator.

C:\>set /a value=!value!+6135
Missing operator.

C:\>set /a value=!value!+5
Missing operator.

C:\>set /a value=!value!+2
Missing operator.
Size is: !value!

Please Help me out in this.
Say where I made mistake ?
I need this very urgent. So please...
Little Helper
15 May 2009 à 04:53
It's a simple spelling error: He meant "setlocal".

Google could have told you this, try googling: sellocal batch script

In the first line, google will say "Did you mean setlocal?".

Have fun.
popsi > Little Helper
19 Dec 2009 à 06:16
awesome script.. thanks a lot mate..
Super Script Dude! :)
Awesome!
Very good!!!!!! tks