Windows right click context menu

Category: Windows
------------------------------------------------------------
Windows allows users to add custom right-click context menu items.

Example:
Let's assume that we need an option to "Open with gVim" for any file in Windows, and it would look like:



This involves registry modifications and the steps are:

1. Goto Run… and type regedit to open registry editor.
2. First back-up present working registry. (goto: File-->Export, and select “All” in Export range)
3. Now goto: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*
4. Following key structure would be present:

5. Create new key named “shell” and create following structure:

6. Now select “cmd” key.
7. Change value of “cmd” key to the string which you want to display in context.

8. Now select “command” key.
9. Change value of “command” key to “\gvim.exe” "%1"

10. Exit from registry editor.
11. Right click on any file and “Open with gVim” will be displayed!

Notes:
- Either create a backup of registry or create a system restore point. As if anything goes it would be recoverable.
- Double quotes in "%01" are necessary as those take care of path names with spaces in-between.
- I have tried this with WindowsXP.


-------------------------------------------------------------

Comments