I need to run MSBuild from the command line using the Visual Studio Command Prompt (2010). It used to work fine. Now when I open the window I get the following error message
My problem was that inside of an if block the rval of a variable assignment (%PATH% in my case) contained a parentheses, for example:
set var=foo ) got ya
if 1 == 2 (
set var2=%var%
)
Displays "got was unexpected at this time."
I found the answer here: Batch file variable with spaces and parentheses. Which is to use the extended syntax of set. For example:
set "var2=%var%"
This does not add quotes and does not affect the result stored in %var2%.