Dos Command/Batch file to find a folder size

Solved/Closed
trusp
Posts
4
Registration date
Wednesday December 3, 2008
Status
Member
Last seen
December 5, 2008
- Dec 4, 2008 at 06:41 AM
 Mandarilho - Dec 18, 2012 at 10:26 PM
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 replies

trusp
Posts
4
Registration date
Wednesday December 3, 2008
Status
Member
Last seen
December 5, 2008
43
Dec 5, 2008 at 04:50 AM
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...
45
Little Helper
May 15, 2009 at 04:53 AM
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.
0
popsi > Little Helper
Dec 19, 2009 at 06:16 AM
awesome script.. thanks a lot mate..
0
Super Script Dude! :)
Awesome!
0
Very good!!!!!! tks
0