@echo off
pushd
setlocal enabledelayedexpansion enableextensions
set VARY=before
if "!VARY!" == "before" (
set VARY=2
if "!VARY!" == "2" @echo If you see this, yes echo !VARY!
)
set VAR=before
if "!VAR!" == "before" (
set VAR=1
if "!VAR!" == "1" @echo If you see this, it worked
)
popd
Expected Output:
If you see this, yes 2
If you see this, it worked
Actual Output:
If you see this, it worked
Can someone explain why is the output not showing "If you see this, yes 2" as well?