In this piece of code I'm trying to make a list fit the screen in WinPE by alternating into two columns. But when I put !modelsvar[%increment%]:~20!
in the echo it returns only ~20. Strange because !modelsvar[%%D]:~20!
works fine. I've tried many variations of ! and % but no luck. Anyone know if there's is a specific rule that I'm missing?
I have setlocal enabledelayedexpansion
enabled
set modelsx=%counter%
set /a counter=0
for /l %%D in (1,2,%modelsx%) do (
set /a counter+=1
set /a increment=!counter!+1
ECHO !counter!. !modelsvar[%%D]:~20! !increment!. !modelsvar[%increment%]:~20!
set /a counter+=1
)