Via a *.cmd script I do
set "test = zzz" at the command line and then
"echo %test%" and what's echo'd back to me isn't
zzz, as I'd expect, but
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Your invocation of the
set command actually works, but it doesn't do what you expect.
The command prompt treats the spaces surrounding the equality sign (
=) literally. As a result, the command sequence
set test = zzz echo %test% echo %test %
prints the following:
Since the variable
test is unset,
%test% doesn't get replaced.