Monday, March 12, 2012

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\Desktop\Background\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.