views:

413

answers:

5

I have 3 different versions of Visual Studio installed on my machine, VS2002, VS2008, VS2005,

How do I start a particular version of Visual Studio using command prompt.

devenv.exe opens latest visual studio. What should I do if I want to open VS2003

using command prompt.

+1  A: 

Use devenv.exe for the specific version of Visual Studio. There will be one located in the Common7\IDE folder of the install. Here are the directories as I remember for the various versions.

  • 2008: %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\Ide\devenv.exe
  • 2005: %ProgramFiles%\Microsoft visual Studio 8\Common7\Ide\devenv.exe
JaredPar
A: 

use an abolute path i.e: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe

Mitch Wheat
In Vista OS Type this command "devenv" in start search and give enter. it will open the current version of VS sdk.
Jeyavel
+4  A: 

You have to use the path to distinguish them. For instance here is the VS2005 command on my laptop:

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

Here's another tip: You can figure out how to run various windows apps from the command line by finding them in the Windows Start Menu, right-clicking on the icon, select properties, and then on the Shortcut tab, look at the Target textbox. Copy that text out and usually you can use it at a console command line.

RBarryYoung
A: 

Sara Ford has some tips on various command line switches here

search for devenv

benPearce
Linked page says "No Results"
Andrew Medico
seems to not allow a search to come from an external address
benPearce
A: 

You can also use the "Visual Studio 2005 Command Prompt" and "Visual Studio 2008 Command Prompt" to load a version-specific command shell environment, and then run 'devenv'. This is typically found under Start->Programs->Visual Studio ->Visual Studio Tools

If you can't or don't want to access it via the Start menu, you can also "load" the VS-version specific environment in a normal command shell using the following (for VS 2008, with a default install path): (note: change x86 as appropriate for your platform)

(32 bit) %comspec% /k ""C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"" x86
(64 bit) %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcvarsall.bat"" x86

or for VS 2008 (with default install path):

(32 bit) %comspec% /k ""C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86
(64 bit) %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86

Each sets the environment so if you then subsequently execute 'devenv' it'll load the correxct version.

RobS