I have the name of a variable stored inside another variable and i would to find the value of variable the first variable.
I wrote this code to solve it.
set var1=aaa
set var2=bbb
set var3=ccc
set var4=ddd
echo pick number 1 to 4
set /p ReturnCode=
set answer=%%var_%ReturnCode%%%
echo %answer%
My trouble is it gives name of variable back instead of value.
For example, if i enter 3 to chose instead of outputting 'ccc', it outputs 'var_3'. I would appreciate any help you could give, Thanks.