How can I set an "open with" keyboard shortcut in windows 7?

I have a shortcut to open vim, but I would like to create a shortcut to open the currently selected file in windows explorer with vim (if that is not the program associated with the file's type).

Using the shortcut for the executable opens it with no file selected.


Solution 1:

Create an entry in HKEY_CLASSES_ROOT\*\shell

1. Right-click it and choose new key - Name it "Open with VIM"
2. Right Click the new key - choose new key - and name it "command"
3. Set that key's default value to "PathToVIM" "%1" with quotes

It is a mouse shortcut, instead of keyboard. From then on right clicking on any file with give a "Open with VIM" in its context menu.

Solution 2:

Works perfectly well as mentioned on microsoft's site https://answers.microsoft.com/en-us/windows/forum/windows_vista-desktop/right-click-open-with-command-missing-help-please/a9c3f139-075c-4285-b87d-25e899fb8b27

By design, the Open With menu option is not available when you right-click executable files (.cmd, .bat, .pif, .scf, .exe, .com, or .scr), or shortcuts to executable files.

If you've lost the Open With menu option for ALL file types, including non-executable files, follow this steps:

  1. Click Start, All Programs, Accesories, Notepad.

  2. Copy and paste this text:

  3. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT*\shellex\ContextMenuHandlers\Open With] @="{09799AFB-AD67-11d1-ABCD-00C04FC30936}"

  4. Click File, Save As, name the file "OpenWith.reg" (WITH THE QUOTATION MARKS) and click OK.

  5. Now double-click OpenWith.reg, click Continue, Yes, OK, and see if the problem is solved.

Hope it helps.