NotDan
NotDan

Reputation: 32213

How can I add a new option to the explorer right click context menu?

I would like to add a right click menu option to Windows explorer for all .sln files that says "Build." It just needs to call devenv to build the sln without opening it first. What is the easiest way to do this?

Note that I am using Windows Vista, if that matters.

Solution

I found a simple solution for Vs2008 on 32bit windows. Create and run .Reg file with this:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Build (Debug)\command]
@="\"C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.com\" %1 /Build Debug"

And make sure the path to Visual Studio is correct.

Upvotes: 3

Views: 1175

Answers (2)

NotDan
NotDan

Reputation: 32213

Create and run .Reg file with this and make sure the path to Visual Studio is correct.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Build (Debug)\command]
@="\"C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.com\" %1 /Build Debug"

The above example is for VS2008 on 32 bit windows. For newer versions of Visual studio update the path to the Common7 folder

  • VS2008 - Microsoft Visual Studio 9.0
  • VS2010 - Microsoft Visual Studio 10.0
  • VS2012 - Microsoft Visual Studio 13.0
  • VS2013 - Microsoft Visual Studio 12.0

If you are running 64bit (x64) windows the path will be:

"C:\\Program Files (x86)\\Microsoft Visual Studio ??.0\\Common7\\IDE\\devenv.com\"

Upvotes: 4

t3rse
t3rse

Reputation: 10124

You would be needing to write a shell extension. See:

http://www.theserverside.net/tt/articles/showarticle.tss?id=ShellExtensions

Upvotes: 3

Related Questions