- May
- 13,823
- 211
Using SETLOCAL on the command line was mentioned in another thread. I had never used it so I played with it a bit. I don't quite understand what's happening below. In the first example, second ECHO, why is %zz still 2? In the second example why isn't the same thing echoed twice?
Code:
v:\> setlocal & set zz=2 & echo %zz & endlocal & set zz & echo %zz
2
TCC: Not in environment "zz*"
2
v:\> setlocal & set zz=2 & echo %%zz & endlocal & set zz & echo %%zz
%zz
TCC: Not in environment "zz*"
ECHO is OFF