I like most of other developers have several versions of Visual Studio installed on my computer and it can be a hassle to get the correct version to open using a batch file.
I have a batch file that starts up the program that I normally use during the day and in this I have a start of Visual Studio. Now that Visual Studio 2013 has arrived I installed this on my machine that already have Visual Studio 2012 and 2010.
For my current project I need to use Visual Studio 2012 (due to an old TFS) so I want the batch file to start the correct version.
I have the followin line in the batch file
start /d "D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\" devenv.exe
This started to start up Visual Studio 2013 anyway and I couldn't understand why until I stumble upon the solution on another webpage.
I turns out that Windows associates devenv with a specified directory path through a setting in the register
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe
This key was set to
D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe
which meant that Visual Studio 2013 was started, to get Visual Studio 2012 to start instead I just needed to change the register setting to
D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe