• ARTICLES
SEARCH

How-To Geek

How to Add Any Application Shortcut to Windows Explorer’s Context Menu

With a quick registry tweak, you can add any application to any Windows Explorer context menu. You can even add application shortcuts to your desktop’s context menu and launch your favorite applications just by right-clicking on your desktop.

We’ve previously covered adding an “Open with Notepad” option to any file’s right-click menu in Windows Explorer, but you can do much more than that.

Getting Started

First, launch regedit.exe from the Start menu.

Expand the HKEY_CLASSES_ROOT key.

Specific File Types

As an example, let’s add an option to the context menu for .gif files.

First, scroll down to the .gif key under HKEY_CLASSES_ROOT.

Select it and look at its “(Default)” value. In this case, the default value is “giffile”.

Head to down to the giffile\shell key, also under HKEY_CLASSES_ROOT.

First, right-click the shell key and create a new key. Name the key what you want the option to appear as in the menu. Next, right-click the key you just created and create a new subkey under it. Name the new key “command.”

Double-click the “(Default)” value in the command key and enter the path to the .exe file in the following format:

C:\\Program Files\\Something\\something.exe %1

Be sure to use the double backslashes and end the path with %1. The %1 passes the selected file name to the program.

The option will appear immediately.

Only When Pressing Shift

To have a shortcut appear only when you press Shift while right-clicking, create a string value named “Extended” in the action’s main key.

All File Types

The HKEY_CLASSES_ROOT\*\shell key holds options that appear when you right-click any type of file.

First, navigate to the *\shell key.

Next, create a key with the same structure.

You’ll see the option when you right-click any type of file.

Desktop Menu

Use the HKEY_CLASSES_ROOT\DesktopBackground\shell key to have a shortcut appear when you right-click the desktop.

Omit the %1 part of the command because you only want Windows to launch the app, not try to pass anything to it.

Folder Menus

Use the HKEY_CLASSES_ROOT\Directory\shell key to have the option appear when you right-click a directory.

Use the HKEY_CLASSES_ROOT\Directory\Background\shell key to have an option appear when you right-click the background of a directory in a Windows Explorer window.

Creating a .Reg File

You can create .reg files that do this for you. Let’s create a .reg file for the .gif example.

First, we’d launch Notepad or another text editor. Then, we’d enter the following text:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\giffile\shell\Open with Something\command]
@=”C:\\Program Files\\Something\\something.exe”

Save the file with the .reg file extension. You can double-click it to add the information to your registry.

A single .reg file can contain multiple entries, so you could have one .reg file that installs all your favorite shortcuts.

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 03/12/12

Comments (28)

  1. martin

    Good to know about the How to Add Any Application Shortcut to Windows Explorer’s Context Menu

  2. SuperArsha

    didn’t work, when I try to open the file it asks me what software do I want to open it with everytime!

  3. SuperArsha

    http://i.imgur.com/gSGpC.png this is what I get

  4. Dave stibrany

    This is so damn useful to know. Thanks!

  5. Bill Medley

    These are great! It helps to under the register. plz have more.

  6. James O'Brien

    Nice, thanks!

  7. walter kirsch

    Great hack!

    Now, how’s about a hack to add an entry to the “Open with…” sub-menu? The advertised way won’t work with some old 32-bit XP apps on 64-bit Vista – some registry entry missing, possibly.

  8. Iszi

    This is a great tweak to know. Could you do a write-up of how to add an icon to your menu item, like there is in your screenshots for “Scan with Microsoft Security Essentials…”? I’ve found some tips on this for Windows 7 on SuperUser (http://superuser.com) but am having a hard time getting it to work on XP.

  9. hArLtRoN

    Good to know. I will have to try this when I get home. I have wondered for a long time how to do this. I have seen screen grabs with alternative context menu shortcuts.

  10. Aleksa

    Fantastic idea! Very useful!

  11. James

    No such key HKEY_CLASSES_ROOT\Desktop on my XP machine. Can this be done with XP?

  12. Len

    This was wonderfully informative. Now I wish I could find a way to add the command “close window” to all context menus. Most of my time is spent on a trackball, not typing, and this would be very useful to me.

  13. Doug.S

    A useful free app to do similar w/o user direct reg hacks (done from within the app behind closed doors) is FileMenu Tools
    Has other features as well, easy to use.

  14. Chris Hoffman

    @James

    Oops, looks like it should be “DesktopBackground” instead of “Desktop\Background,” as in the screenshot. Sorry about the typo, I’ll fix that right now!

  15. Duud

    Thanks, I think I’ll understand it eventually. Meanwhile,
    @ Doug.S
    Thanks. I got lost trying to follow the how-to. I’ll try the program you mentioned.

  16. Chris Hoffman

    @Iszi

    Nice idea. I’ll try to do that one soon.

    @walter kirsch

    You should be able to get a program in there just by using the Choose default program option. Uncheck the “always use the selected program” check box and it will just appear in the menu instead of being the default program — does this not work?

    @Doug.S

    Thanks, that looks very interesting!

  17. Chris Hoffman

    @SuperArsha

    Hmm, okay… If you go down to HKEY_CURRENT_USER\Software\Classes\.mp3, is (Default) under .mp3 defined as something other than “mplayerc.mp3″? If so, your option under mplayerc.mp3 might not be getting applied. That’s my best guess.

    You can also try a utility like FileMenu Tools, which Doug.S recommended. This will do the tweak for you.

  18. watson123

    Thanks for giving the information about the How to Add Any Application Shortcut to Windows Explorer’s Context Menu.

  19. myron

    Thanks for giving more information about the How to Add Any Application Shortcut to Windows Explorer’s Context Menu.It is useful.

  20. EL

    Can I add to the right-click menu to open a certain file in a program?

  21. Chris Hoffman

    @EL

    A certain file type? The method here will work for that — check out the GIF example. You can also try something like FileMenu Tools, which was recommended above, if you’d rather not do this part yourself.

  22. robert

    Great article!!
    To know about the How to Add Any Application Shortcut to Windows Explorer’s Context Menu

  23. Keith Badeau

    I didn’t know how to add to the extended menu–thanks. I’ve been customizing file types’ default icon and changing and adding opening and editing applications for a while now. I write .reg scripts so when I periodically wipe the drive and reinstall everything I can quickly get the finished product the way I like it.

    I download custom icons that are “in line” with the theme I like to keep my computer in (clean and minimal with 256px icons). Under the key say, for example, giffile you will find a key called DefaultIcon that holds the path to the icon, which can be an ico, exe, or dll file.

    I use an app call IconViewer from Bot Productions that installs a shell extension that you can access on a files (ico, dll, exe) context menu which displays all the icons and there respective numbers to access them (e.g. imageres.dll, -17).

    I hope that helps someone. Thanks again.

  24. Jod

    I´m trying to Open an AUDIO CONVERTER APPLICATION when I right-click a .WAV file, the Application does open but the File that I right-click IS NOT ADDED to the application. I tried this command:
    “C:\MyAppsFolder\MyAppName\MyApp.exe” –add “%1″
    I tried with double backslashes, with and without quotes and with and without –add
    Any idea?

  25. Chris Hoffman

    @Jod

    Well, it’s going to depend on the application itself. You’ll have to check the command-line options the application uses.

  26. Jod

    Thanks! I made it! I´m now converting .wav files to .mp3 directly from the Explorer´s shell using the command-line support of my AudioConverter app. I only have two little things that I would like to fix:

    1. a .wav file called ring.wav converts to a .mp3 file called ring.wav.mp3 , that´s because the parameter %1 returns the complete file name with the extension (.wav) and throws it to the new .mp3 filename. Is there a way to get only the filename (without the extension) from the %1 parameter?

    2. While converting I can see a DOS Window popping-up! When I convert 2 files at once I see two DOS windows, etc. Is sthere a way to HIDE these MS-DOS windows? or … at least can I use a for cicle to batch-convert my .wav files?

  27. Chris Hoffman

    @Jod

    1. Not as far as I know — not with Windows at least. Maybe a third-party program could help you with this? The official page at http://msdn.microsoft.com/en-us/library/windows/desktop/cc144101(v=vs.85).aspx doesn’t offer any tips.

    2. I think this is caused by the program itself. I’m not sure how to avoid it — maybe a file converter with an integrated right-click menu option would be more integrated? Just an option.

  28. Jod

    Thanks! I appreciate your comments and the knowledge you share with us.

Enter Your Email Here to Get Access for Free:

Go check your email!