Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Command Prompt gives "\Common was unexpected at this time"

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:

\Common was unexpected at this time.

Trying to run the msbuild command after that fails.

I naturally assumed it was an issue with an unquoted entry in my PATH environment variable, possibly from a recent rogue install. I checked that, but the PATH seems to be kosher.

Digging into the file system, I discovered that the batch file being run by the prompt is C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat. I edited that by putting in ECHO statements to trace the location of the error. That seemed to point to an error at this line:

@if not "%WindowsSdkDir%" == "" (

If I remove the quotation marks, the error is different: "Files was not expected at this time."

The next 2 lines after this are now:

@echo 51
@set "PATH=%WindowsSdkDir%bin\NETFX 4.0 Tools;%WindowsSdkDir%bin;%PATH%"

I assumed the failing statement was the second line, but the echo statement doesn't produce any output, so I don't know how that could be happening.

I am using a 64-bit version of Windows 7.

I would appreciate any help at all.

like image 333
Richard Avatar asked Jan 06 '12 11:01

Richard


1 Answers

See this thread.

My guess is your PATH got modified recently and now contains some folder path with quotation marks inside.

HTH

like image 184
Hertzel Guinness Avatar answered Sep 24 '22 19:09

Hertzel Guinness