I am writing a for loop in a batch file, which is to do arithmetic to a variable each iteration. The loop looks like this:
@echo off
setlocal enabledelayedexpansion
SET d=10
echo !d!
for /L %%t IN (0,1,9) DO (
SET /A d = %d% + 10
echo !d!
)
The arithmetic only is good for the first iteration. 'd' is to start at 10 and add by ten each time (10 20 30 ...) but it always stops at 20. In the output of the command prompt it will show:
10
20
20
...
20
20
How can I write this so it will add by ten for the entire loop?