I would like to add an entry to the Windows right-click menu that only appears when I right click on a .exe or .msi file. If the entry is selected, the exe file will be executed (like Open) but with a fixed text string as its argument.
I guess this should be possible with a registry key – any ideas how to do this?
For an
.exefile, you can do the following in the registry:HKEY_Classes_Root, find key.exe(Default)value (this is usuallyexefile)HKEY_Classes_Root, find keyexefile(or whatever you found in step 2)exefile\shellcreate a new key, with a name matching what you want to see in the context menu (say, “Open With My App”)command(Default)value of this key to whatever commandline you want to execute. The name of the file you clicked on can be entered using the token%1. So, for example, you could set the value tonotepad.exe %1to edit the executable in Notepad.A similar pattern will work for other file types.