Question

There is a need to add item to particular file type's context menu. In Windows 7 and previous versions that's done by adding

HKEY_CLASSES_ROOT\<extension>\shell\<commandname>\command

key with value of

@="<path_to_app> \"%1\""

to registry. In Windows 8 that doesn't work. Even after deleting PersistentHandler key of respective type : registry screenshot

What's interesting, if shell/command keys are written in HKEY_CLASSES_ROOT\*\ section, context menu item appears in menu for all files as expected, but that's a huge overhead in case what I need is add my application to only 2-3 filetypes without breaking any existing associations. I'm using Microsoft.Win32.Registry.ClassesRoot in C# to implement this logic, but the problem is definitely not in code because a) it works in Windows 7 b) manual editing with administrator previledges in Windows 8 doesn't add needed association.

Was it helpful?

Solution 2

"HKEY_CLASSES_ROOT\SystemFileAssociations\video" is "real" subtree for .avi files in systems with non-WMP default media player. .mkv file type that i was interested in also creates another subtree - "mkv_auto_file". Don't know why it's done and where it's documented, but my problem was solved. Thanks Hans for guiding.

OTHER TIPS

You must have noticed that there wasn't a "shell" key originally there, even though .avi files certainly have an Open context menu item. There's an extra level of indirection, note the default value of the .avi key. That's the ProgId associated with the .avi filename extension.

Follow that to the WMP11.AssocFile.AVI key to find the shell commands, add your command there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top