How to check the folder size using dos progra

September 5, 2010 at 10:17:59
Specs: Windows XP
How to check the folder size using dos command

See More: How to check the folder size using dos progra

Report •

#1
November 10, 2010 at 00:12:01
check the following link: http://www.programmersheaven.com/mb...

you have two methods,

First Method:
1.create a batch file call it FindSize.bat
2. copy/paste the following code inside it:
@For /F "tokens=*" %%a IN ('"dir /s /-c | find "bytes" | find /v "free""') do @Set summaryout=%%a
@Echo %summaryout%
@For /f "tokens=1,2 delims=)" %%a in ("%summaryout%") do @set filesout=%%a&set sizeout=%%b
@Echo %filesout%
@Echo %sizeout%
@Set sizeout=%sizeout:bytes=%
@Echo %sizeout%
@Set sizeout=%sizeout: =%
@Echo Size is :%sizeout%

3. this batch will check the total size of the directory (+subdirectories)

second method:
1.create a batch file call it FindSize.bat
2. copy/paste the following code inside it:
setlocal enabledelayedexpansion
set dir=%1
set size=0

for /R %dir% %%F in (*) do ( set /a size=!size!+%%~zF )

echo %size%
endlocal


Thanks,
Nabilaal@gmail.com


Report •
Related Solutions


Ask Question