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
I had quotation marks (") in the PATH variable that caused this, after I removed them it started working.
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%.
See this thread.
My guess is your PATH
got modified recently and now contains some folder path with quotation marks inside.
HTH
Also, the semicolon symbol (";") at the environment variables list can cause the same behavior on Win 10.