I have a loop in a batch script and I would like to do some arithmetics with the loop counter. I found out how to evaluate expressions, how to add numbers here: Evaluating expressions in windows batch script
How do I do the same but with variables?
For example:
set x = 100
for /L %%i in (1,1,5) do (
set Result=0
set /a Result = %%i+%%x
echo %Result%
)
As output I would expect
101
102
103
104
105
Thanks!
Best Answer
You really should move away from Batch files.