Thursday, June 14, 2018

Not all context menu items are directly in the Registry

One user wanted to find the command line equivalent of context menu items. This is straightforward for items that are configured in the Registry to launch a process with arguments (in the command subkey under a subkey of shell, which is a subkey of a file type key in HKEY_CLASSES_ROOT). However, some context menu items are actually created at runtime by shell extensions or the shell itself. Context-menu-affecting shell extensions are listed in the ContextMenuHandlers subkey under shellex. Of course, those are COM objects that can do anything they want in response to the menu item being clicked, so there's no simple way to invoke their functionality from the command line. One strategy is to use Process Explorer to see the command line of any new processes that result from clicking the item.

No comments:

Post a Comment