views:

72

answers:

1

I have recently installed VS2010. The installation creates the short cut 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

I need to urgently run the VS2010 command prompt to resolve other issues. Please help me.

Thanks!

A: 

This same problem just started occurring for me and I was able to "fix" it by updating the vcvars32.bat file located in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\ folder (by default). Add the following after the first line:

@SET VSINSTALLDIR=c:\Program Files\Microsoft Visual Studio 10.0
@SET VCINSTALLDIR=c:\Program Files\Microsoft Visual Studio 10.0\VC
@SET FrameworkDir32=c:\Windows\Microsoft.NET\Framework
@SET FrameworkVersion32=v4.0.30319
@SET Framework35Version=v3.5

And then comment out the following lines:

:: @call :GetVSCommonToolsDir
:: @if "%VS100COMNTOOLS%"=="" goto error_no_VS100COMNTOOLSDIR
:: @call "%VS100COMNTOOLS%VCVarsQueryRegistry.bat" 32bit No64bit

Found this here. Note that I say fix in quotes because I haven't checked to make sure that all the appropriate variables are set properly; that said, at a cursory glance it does appear to be valid.

Note that you'll have to edit the vcvars32.bat file in an elevated text editor (ie, Run as Admin) to be able to save the file in Vista and Windows 7.

akmad