Search notes:
cmd.exe: for /l
In
cmd.exe, a sequence of numbers can be created with the
for /l
command:
The command takes three arguments:
- a starting value,
- an increment (which can be negative)
- a maximum (minimum) value
All numbers need to be integers. Except the increment, the numbers need to be positive.
@set startValue=5
@set increment=3
@set maxValue=25
@for /L %%i in (%startValue%, %increment%, %maxValue%) do @(
echo i = %%i
)
The sample prints
i = 5
i = 8
i = 11
i = 14
i = 17
i = 20
i = 23