Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2010 command prompt gives error: Cannot determine the location of the VS Common Tools folder

I have installed VS2010. The installation creates the shortcut for VS2010 command prompt but when I open up the command prompt I get the error:

Cannot determine the location of the VS Common Tools folder.

I checked the environment variable VS100COMNTOOLS and it has value: C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\ and the registry for HKEY_local_Machine\Software\Microsoft\Visual Studio\SxS\VS7 is set to: C:\Program Files\Microsoft Visual Studio 10.0\.

I checked the VSvars32.bat and tried to add echo to find till where it proceeds. It fails at this command:

@call :GetVSCommonToolsDirHelper32 HKLM > nul 2>&1 
like image 953
SPk Avatar asked Aug 11 '10 17:08

SPk


People also ask

How do I open the Tools in Visual Studio command prompt?

On the Start screen, press Ctrl+Tab to open the Apps list, and then press V. This brings up a list that includes all installed Visual Studio command prompts.

Where is Visual Studio CMD installed?

For Visual Studio 2015, the typical installation location on a 64-bit system is in \Program Files (x86)\Microsoft Visual Studio 14.0 . The primary developer command prompt command file, VsDevCmd. bat , is located in the Common7\Tools subdirectory.


2 Answers

I had the same issue and found the answer here.

The problem is that the bat uses de reg command and it searches that in the PATH system variable. Somehow you have managed to get "C:\Windows\System32" out of the PATH variable, so just go to the system variables (right click "My Computer" > "Properties" > advanced config > "Environment Variables", search the PATH variable and add at the end separated by ";" : C:\Windows\System32

like image 100
kzfabi Avatar answered Sep 28 '22 00:09

kzfabi


I had the same problems in two machines: Win8.1x64 with Visual Studio Ultimate 2013 (VS2013) and Win8x64 with VS2013 ultimate

Problem: Shortcut "VS2012 x86 Native Tools Command Prompt" which points to file: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat which calls C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat tries to search the registry for value name "11.0":

reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "11.0" 

However my machine doesn't have this value "11.0", instead it has "12.0"

My solution is to run C:\Program Files (x86)\ Microsoft Visual Studio 12.0 \VC\vcvarsall.bat which calls C:\Program Files (x86)\ Microsoft Visual Studio 12.0 \VC\bin\vcvars32.bat which correctly query the registry as the following:

reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "12.0" 

So changing/running from C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat to C:\Program Files (x86)\ Microsoft Visual Studio 12.0 \VC\vcvarsall.bat solved it in my case

like image 34
Khaled Avatar answered Sep 28 '22 00:09

Khaled