Batch: Returning a value from a SETLOCAL EnableDelayedExpansion
-
29-10-2019 - |
문제
I wonder why this code does not work as expected:
@ECHO off
SET S1=HELLO
SETLOCAL EnableDelayedExpansion
SET S2=!S1! WORLD^^!
ECHO !S2!
ENDLOCAL & SET S1=!S2!
ECHO %S1%
PAUSE
Output:
HELLO WORLD!
!S2!
Expected output:
HELLO WORLD!
HELLO WORLD!
Thanks.
올바른 솔루션이 없습니다
제휴하지 않습니다 StackOverflow