3

I was inspired by my other question to try the following:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\.sln]

[HKEY_CURRENT_USER\Software\Classes\.sln\shell]

[HKEY_CURRENT_USER\Software\Classes\.sln\shell\countlines]
@="countlines"

[HKEY_CURRENT_USER\Software\Classes\.sln\shell\countlines\command]
@="c:\\countlines\\countlines.exe" %1

This should be adding a context menu item named "countlines" that runs the "countlines.exe" command, but it doesn't work.

How does one add a context menu entry for a given file extension?

  • Here's thinking that this is a dupe of the question linked to. OP should be adding this to that question via an edit, no? – marcusw May 03 '10 at 19:18
  • @marcusw: doesn't appear a duplicate to me; if anything it's a more general case (in which case the other question can be closed as a duplicate of this one). – quack quixote May 03 '10 at 19:26

2 Answers2

3

The default value of the .sln key should be something like VisualStudio.Launcher.sln. That's called the program ID (ProgID) and it's the key you should edit to change the context menu:

[HKEY_CURRENT_USER\Software\Classes\VisualStudio.Launcher.sln\shell]

A ProgID key always takes precedence, so any changes made to the extension key will be ignored when a ProgID is present. ProgIDs are mainly used to group extensions into logical file types.

efotinis
  • 4,164
  • 1
  • 22
  • 22
  • @efotinis: slightly unrelated, but is that why jpegs are unaffected [by these registry tweaks](http://superuser.com/questions/133188/disable-thumbnails-in-windows-xp/133220#133220) but avis are? – quack quixote May 04 '10 at 10:08
  • Do you know where to look up the ProgID for a given extension? – Bananach Oct 07 '20 at 13:55
0

This article helps in creating context menus for specific file types.

https://blog.sverrirs.com/2014/05/creating-cascading-menu-items-in.html

bobkush
  • 390
  • 2
  • 10