As Carl said, the leading zero is the sign of octal numbers. Sometimes a leading zero seems useful, since you avoid the error if %1 empty.
But then you have problems that can be solved using a slightly different method.
Turning 1 or better 100 , and then building the module will also work with numbers 8 and 9 (as well as empty input).
set /a iteration=1000%1 %% 100 + 1
But in your case, deleting zero should be enough, even if %1 empty, you got the correct expression.
set /a iteration=%1 + 1
Will expand to set /a iteration= + 1
source share