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:
would never display the message, since the %VAR%
in both "if" statements
is substituted when the...