Add a Right-click Context Sub Menu

I’ve been creating a few tools recently for a client – scripted tools which perform specific tasks on MSI (Windows Installer) files. Because we’re likely to create multiple tools and I don’t want the context menu to get too long and too ugly, so I decided to add a right-click context sub menu.  Here’s what it produces:

context

And here’s the registry that made it happen:

If you look closely, you should see that this context menu will only show for MSI files because we use the Msi.Package progid.  You’ll also note that when we export registry into a .reg file like above, all quotes in the registry values are escaped by a preceeding backslash as indeed are all backslashes!  So a quote would be \” and a backslash would be \\!  As an example (taken from above) the value:

mshta.exe \”\\\\server\\pathtotools\\mycustomtool.hta\” \”%1\”

when imported will resolve to:

mshta.exe “\\server\pathtotools\mycustomtool.hta” “%1”

 

2 thoughts on “Add a Right-click Context Sub Menu

  1. I was looking for something like this!

    Is there a way to apply this on every item you can right click on.
    For example:
    – right click on any file (.exe,  .bat,  .docx,  shortcut (lnk) etc…)
    – right click on any folder
    – right click on empty space on desktop

    Thank you.

     

     

     

    • Hi. Glad you found it useful. You might want to check this article out – it’s probably a little more in depth than my blog when describing the various options you require.

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.