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?

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,370
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
  • 410