0
SETLOCAL EnableDelayedExpansion 
FOR %%A IN (1 2 3) DO (  
IF %%A EQU 1 (  
SET CHOICE1=ABC  
ECHO CHOICE1=%CHOICE1%  
)  
)  

Output:

CHOICE1=

Why is CHOICE1 not getting set?

Kevin Panko
  • 7,466

1 Answers1

0

When using EnableDelayedExpansion you must also use ! around variables you want to delay expanding.

Therefore, instead of %CHOICE1% you must use !CHOICE1!.

Kevin Panko
  • 7,466