How do I use a variable like %%i in a permanent variable? (I don't really know the correct terms, so I hope anyone can figure out what I mean)
This is the code I am using:
@echo off
color 0f
goto number
:number
title number
cls
echo number of options?
set /p num=
goto option
:option
for /l %%i in (1,1,%num%) do (
cls
echo Name nr. %%i
echo Enter a option
set /p n%%i=
echo %%i = %n%%i% >> log.txt
)
goto select
:select
cls
echo %n2%
pause >nul
the "%n2%" works for whatever you put in second, but when I try to print it into a file ( echo %%i = %n%%i% >> log.txt ) it doesn't work. I know the "%n%%i%" is not correct, But I don't really know what to actually put there.