Adding Custom Open With Command to Windows Context Menu

A quick and easy tutorial on how to create an “open with …” command to the context menu (right click menu) in windows. By following and referring to these steps it will be possible to add any program of your choice into the context menu too.

For the purpose of demonstration we will be adding “Open with Sublime Text 3” to the context menu. The default Sublime Text 3 installer does make this task hassle free during the installation process by giving us the option in the installer interface. But in case you forgot to mark the proper checkbox during installation or if like me you did a silent installation, you can follow these instructions to get what you’ll be missing otherwise.

It is just a simple matter of adding some new entries into the registry. For doing it manually follow the steps given below.

FOR ANY FILE TYPES

To make the option available on context menu of any file type.

Step 1: Opening the registry editor: ‘windows key’ + R, type regedit and enter.

run regedit
Opening Regedit with Run

Step 2: Navigate to HKEY_CLASSES_ROOT\*\shell

Step 3: Right click on shell and create a New Key named Open with Sublime Text 3

add new key

Step 5: Adding the icon: Right click the newly created Open with Sublime Text key, and create a new Expandable String Value. Name it ,icon with value data C:\Program Files\Sublime Text 3\sublime_text.exe,0 (the path is the location of the executable file)

create expandable string value

Step 6: Adding the magic: Right click Open with Sublime Text 3, and create a new “Key” named command</code>, then select it and modify (default to C:\Program Files\Sublime Text 3\sublime_text.exe %1

open with sublime text 3, files
Making the context menu option available for files of any type

FOR ANY FOLDER

Now to make the option available on folder context menus.

Step 1: Opening the registry editor: ‘windows key’ + R, type regedit and enter.

Step 2: Navigate to HKEY_CLASSES_ROOT\Folder\shell\

Next, follow Step 3 to Step 6 as before.

open with sublime text 3, folders
Making the context menu option available for folders

You may also like...