Very simple, I guess... I need to get a usable variable by adding leading zeros to the loop index variable (%%i) below.
@echo off
for /L %%i in (1, 1, 5) do (
echo %%i
rem How to create a variable j here as a
rem result of adding leading zeros to %%i? (001, 002, 003 etc.)
)
pause
How? I've tried the following, but I can't get the value out of the %%i variable inte the var_ at a...
@echo off & setlocal enableextensions
for /L %%i in (1, 1, 5) do (
echo %%i
set var_=00000%%i
set var_=%var_:~-5%
echo %var_%
)
pause