lescluster
asked on
Batch - size of directory question.
Is it possible to detect size of directory and if so what would be the syntax to do that with batch file and echo out the result ot text file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Steve
It appears that all I am getting is the size of the file in that directory but not in the subfolders. I have subfolders in the misc directory that I would like to include in the count. I am using your script like that:
@echo off
cd \documents and settings\misc
for /f "tokens=3" %%a in ('dir /-c ^| find "File(s)"') do set sizeofdir=%%a
echo Size of dir %cd% is %sizeofdir%
Thanks
It appears that all I am getting is the size of the file in that directory but not in the subfolders. I have subfolders in the misc directory that I would like to include in the count. I am using your script like that:
@echo off
cd \documents and settings\misc
for /f "tokens=3" %%a in ('dir /-c ^| find "File(s)"') do set sizeofdir=%%a
echo Size of dir %cd% is %sizeofdir%
Thanks
ASKER
Steve
I figure that out - had to use \s switch - thanks much for your help
I figure that out - had to use \s switch - thanks much for your help
ASKER
duh - just notice you were already talking about /s - need some sleep.
Thanks again
Thanks again
Haha, no problem. glad to help, was just a quick answer while shutting down PC for the night anyway...
Steve
Steve
dir [dir name] | find "File(s)" > results.txt