If you choose to download the portable zip version of a program, for example Sublime Text 2, then you might be missing out on the neat feature of having it added to the right-click context menu in Windows.
When you select a bunch of files, and want them opened with your favourite program, theres no context menu item that says “Open in program name”, such as illustrated in this picture:
This can be added through editing the registry.
- (take a backup of your registry)
- Open the registry editor (run -> regedit.exe)
- Right click on the shell folder, and select New -> Key
Give the key the name you would like in the context menu, for example “Open with Sublime Text “
- Right click on the newly created key (“Open with Sublime Text”), and select New -> Key to create a sub-key. Call this sub-key “command”
- Double click the (Default) string inside the newly created “command” folder, and enter the path to your program, in this case, Sublime text 2:
C:\dev\SublimeText2.0\sublime_text.exe "%1"Make sure you also enter
"%1", including the quotes.
(Omitting the quotes would mess this up, as it would send the wrong parameters to the program, and open wrong files)
- If you now right-click a file, you should see the “Open with your program” option in the context menu.
You can also add an icon for your context menu item:
- Right click on the “Open with Sublime text” folder in regedit, and select New -> String
- Call it “Icon” and enter the path to your icon resource, or .ico file:
- Right-click a file, and see if your icon is showing!
You could also save the text below as a .reg file, and run it.
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2] "Icon"="\"C:\\\\dev\\\\SublimeText2.0\\\\favicon.ico\"" [HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command] @="C:\\dev\\SublimeText2.0\\sublime_text.exe \"%1\""