1.

Solve : Assigning value to variable from another variable?

Answer»

Hi, am trying to assign the value to the variable by passing it from another variable. its not WORKING. Below is what am trying to do

set vendor5=3
set x=5
set VENDOR=vendor%x%
echo %vendor%

The above script displaying "vendor5". i WANT to display 3 as i assigned 3 for vendor5 in first line.
please let me know what i am missing  . thanks in advance  ...
Without USING delayed expansion
Code: [Select]set vendor5=3
set x=5
call set vendor=%%vendor%x%%%
echo %vendor%Using Delayed Expansion
Code: [Select]setlocal enabledelayedexpansion
set vendor5=3
set x=5
set vendor=!vendor%x%!
echo %vendor%thank you Squashman



Discussion

No Comment Found