@echo off setlocal EnableDelayedExpansion for /l %%i in (1 1 5) do ( set var%%i=%%i ) echo %var1% %var2% %var3% %var4% %var5% echo !var1! !var2! !var3! !var4! !var5! pause