Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing Directory Sizes

Status
Not open for further replies.

egodette

Technical User
Jun 12, 2002
222
US
Trying to automate a daily task. By how much have directory sizes changed.

Code currently. (works perfect but has to be run manually to fill %1 var)

@echo off
setLocal EnableDelayedExpansion
set /A value=0
FOR /R %1 %%I IN (*) DO set /A value=!value!+%%~zI
@echo %1: !value!

I have a file with all the directory names (dir.txt)
How do I auto fill the var %1 with the names from dir.txt?

Follow code does not work.
@echo off
setLocal EnableDelayedExpansion
for /f %%1 in (dir.txt) do (
set /A value=0
FOR /R %%1 %%I IN (*) DO set /A value=!value!+%%~zI
@echo %%1: !value!
)












 
Why not a VBS using FileSystemObject ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top