3
@echo off  
set a=b  
set b=c  
echo %%a%%

It doesn't work, it only shows %b%. I want to make it to show c. I don't know why if it is only the version of the OS (Windows 7 Ultimate Service Pack 1) or it really wouldn't work.

Krish Munot
  • 1,093
  • 2
  • 18
  • 29
Noob
  • 25
  • 6

1 Answers1

3

you need another parsing layer: Either:

call echo %%%a%%%

in batchfiles, or on command line:

call echo %%a%% 

or using delayed expansion:

setlocal enabledelayedexpansion 
set a=b
set b=c
echo !%a%!
Community
  • 1
  • 1
Stephan
  • 53,940
  • 10
  • 58
  • 91