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!
)
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!
)