30

I have both VS 2008 and VS 2010 installed in my PC (Windows XP). Now I try to open IDE via Start -> Run -> devenv it always open VS 2008 environment. Is it possible to change this settings ?? That is I do want to open VS 2010 when I type devenv in Start -> Run

Graciously welcoming any help.

Jith
  • 1,701
  • 3
  • 16
  • 22

3 Answers3

49

These are the steps for windows 7:

  1. Press windows + r to open run window and then write "regedit" to open your PC registry.

  2. Then go to HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> Windows -> Currentversion -> App Paths -> devenv.exe

  3. Click on devenv.exe and change the value of default.

When you open default it has value like C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe

You need to change the value to your other installation, maybe C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe

After completing steps above, when you run devenv command it opens vs2010.

Pramod Nepal
  • 506
  • 5
  • 2
  • Ahh.. in my case it is not working. I am getting error -"Can not edit - error writing the values new content". I am using Windows 7. – GirishK Sep 30 '11 at 06:50
  • @GirishK it may be a _permission issue_, have a look on this [link](http://windows7themes.net/windows-7-registry-changes.html) – Jith Oct 08 '11 at 02:17
  • @Jith Yupp.. It was permission issue.. Got it solved from admin.. Thanks :) – GirishK Oct 11 '11 at 08:40
  • @GirishK: It's simple, if you don't have admin rights, you cannot alter the registry keys in HKLM. You need to set them in HKCU ==> [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe] @="C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE\\devenv.exe" – Stefan Steiger Sep 05 '14 at 06:46
  • You can also add a second devenv, like this:[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\devenv2.exe] @="C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe" – Stefan Steiger Sep 05 '14 at 06:47
  • The path for visual studio 2017 is "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe" – zeus2 Feb 09 '18 at 09:21
  • 2022 compatible (bye x86)! `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe"` And for the lazy, win10 lets you paste in registry paths instead of all the clicking :D `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe` – felickz Feb 10 '22 at 19:39
  • Seems you could go to settings , apps, default apps and type in .sln and change – Tom Stickel Dec 28 '22 at 19:44
4

I would simply find some Visual studio solution file, right click, properties, change the default version from 2008 to 2010

Sudheer
  • 81
  • 7
  • 1
    I think it was downvoted because it doesn't actually resolve what this question is asking. But it does resolve the problem of files associations to the VS of your choice (which is similar to [this old question](https://stackoverflow.com/q/1326506/146513)). – Mariano Desanze Sep 21 '17 at 19:28
1

Consider Visual studio 13 is installed at "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"

Now if I want to make Visual studio 13 as default rather than having Visual studio 15 as default then change the following

enter image description here

Press windows + r to open run window and then write "regedit" to open your PC registry.

Then go to HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> Windows -> Currentversion -> App Paths -> devenv.exe

Siddarth Kanted
  • 5,738
  • 1
  • 29
  • 20