On the command line (and in batch files),
environment variable expansion occurs when the command is read.
This sounds obvious at first, but it has its own consequences.
In the online documentation for SET, one such
consequence is spelled out:
if “%VAR%” == “before” (
if “%VAR%” == “after” @echo If you see this,