I have a command setup in the Registry as a folder association, so I can shift + right-click any folder and open a VS2010 prompt there, instead of having to open a command prompt and then CD to the directory I'm working in. But it's not working...
Setup:
JAVA_HOME
is set to C:\Program Files\Java\jdk1.7.0_04
in Computer > Advanced system settings > Environment Variables...
When I do the following the correct value is output:
Start > Visual Studio Command Prompt (2010) (%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 2010 Premium\VC\vcvarsall.bat"" x86
):
Output (correct):
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
C:\Program Files (x86)\Microsoft Visual Studio 2010 Premium\VC>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.7.0_04
But when I do the following the wrong (old) value is used:
Shift + right-click a folder, select "Open VS2010 prompt here" (cmd /k ""C:\Program Files (x86)\Microsoft Visual Studio 2010 Premium\VC\bin\vcvars32.bat" x86 && cd /d "%V" && title Visual Studio Command Prompt (2010)"
in the Registry):
Output (wrong):
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
E:\Hg>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_27
Why are the values different??? Where is the second instance reading these values from?
%comspec%
in the second entry as well?%comspec%/k ""C:\Program Files (x86)\Microsoft Visual Studio 2010 Premium\VC\bin\vcvars32.bat" x86 && cd /d "%V" && title Visual Studio Command Prompt (2010)"
and called that from the Registry - gives same (wrong) behaviour as 2nd case above.