I try to use with “else” command but I get the foloowing error:
‘else’ is not recognized as an internal or external command,
operable program or batch file.
My code is:
if "zz"=="TRUE" (
copy /a zz + /a ee=/a zz
)
else (
copy /a e + /a %TMP%=/a e
)
What the problem?
The
elseneeds to be on the same “line” (a) as theif. Remove the new-line before theelselike so:Please also note that
"zz"=="TRUE"will never evaluate totrue– I suspect you meant"%zz%"=="TRUE"?(a): This isn’t always a good description, though it’s what the Microsoft documents use. Same command may have been better, and putting
)andelseon a different line breaks it into two commands.