Sep
9
2009

Setting devenv to run Visual Studio version of your choice

Recently I found out that my wife has all VS 2003, VS 2005 and VS 2008 installed in her laptop. It is our usual practice that we hit devenv in Windows run menu to open our Visual Studio IDE. So whenever my wife hit devenv in run window, it always opened VS 2003 editor, where as she wanted it to open VS 2005.

I just now found out how to change this behavior. Windows run menu works by identifying the commands in the particular registry entry.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

The devenv.exe, and its path is defined in that registry key.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe

So when you install VS 2005/2008 and then install VS 2003, this registry key is overwritten.

So you can rewrite this path of devenv.exe to set the proper behavior.

Default path to Visual Studio 2005:

C:\Program Files\Microsoft Visual Studio 8.0\Common7\IDE\devenv.exe

Default path to Visual Studio 2008:

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe

Default path to Visual Studio 2010:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe

Disclaimer: Modifying the registry can cause serious problems that may require you to reinstall your operating system. Use the information provided at your own risk.

About the Author: Utkarsh Shigihalli

Utkarsh Shigihalli works as a Team Lead in one of the globally leading technology, consulting and outsourcing firm. He has developed several Visual Studio addins and other utilities which are well appreciated by many developers.

Leave a comment