for /L %%A in (1,2,40) do echo %%A
This line will iterate from 1 to 39, increasing by 2 each time.
The first parameter, 1, is the starting number.
1
The second parameter, 2, is the increment.
2
The third parameter, 40, is the maximum.
40