How to add an explorer context menu for a file extension?

3

2

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?

asksuperuser

Posted 2010-05-02T10:24:37.013

Reputation:

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 – 2010-05-03T19:18:55.363

@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 – 2010-05-03T19:26:25.637

Answers

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

Posted 2010-05-02T10:24:37.013

Reputation: 3 524

@efotinis: slightly unrelated, but is that why jpegs are unaffected by these registry tweaks but avis are?

– quack quixote – 2010-05-04T10:08:41.093

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

Posted 2010-05-02T10:24:37.013

Reputation: 360