I have the name of an variable saved as a string (it will be read in from a CONFIG file). I would like to evaluate this environment variable, to print its value to the console for example. I am unsure of how to do this.
My current script:
@echo off
set env_var=VIVADO_BAT_PATH_2018_3
set str=set vivado_bat_path=%env_var%
%str%
echo "bat path: %vivado_bat_path%"
set str=set vivado_bat_path=%%env_var%%
%str%
echo "bat path: %vivado_bat_path%"
Its current output:
"bat path: VIVADO_BAT_PATH_2018_3"
"bat path: %env_var%"
Desired Output:
"bat path: C:/Xilinx/Vivado/2018.3/bin/vivado.bat" (or whatever value the env var is set to)
I know that I could get the desired output with echo %VIVADO_BAT_PATH_2018_3%
but I am reading in VIVADO_BAT_PATH_2018_3
as a variable, so how would I go about doing this?