In Windows system variable I have the following variable
x = 123 Data_123 = ddd:
How do I get this variable as a string from batch filet
So at the end I want to get the variable like "Data"_%x% and I will get the value ddd
How can I do that
In Windows system variable I have the following variable
x = 123 Data_123 = ddd:
How do I get this variable as a string from batch filet
So at the end I want to get the variable like "Data"_%x% and I will get the value ddd
How can I do that
you need delayed expansion:
@echo off
setlocal enabledelayedexpansion
set x=123
set data_123=hello
echo !data_%x%!
(there is another method without delayed expansion:
call echo %%data_%x%%%