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

20,947

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.

Share:
20,947

Related videos on Youtube

DanB
Author by

DanB

Updated on September 18, 2022

Comments

  • DanB
    DanB almost 2 years

    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.

  • DanB
    DanB almost 13 years
    I don't want vim to become the new default for that file type. I just want to make it easier to open the file type with vim. For instance, I want html files to default to a browser, but I shouldn't have to search through the menus for the "open with" every time I want to open it with an editor.
  • Traveling Tech Guy
    Traveling Tech Guy almost 13 years
    Then set is as the default HTML editor in your default browser (look for instructions o how to set default applications for your preferred browser)
  • DanB
    DanB almost 13 years
    My goal is to open any file in my editor of choice (which happens to be VIM) with a keystroke-combination. I only gave html as an example, but I don't understand how setting my editor in the browser achieves that goal even for html files.
  • DavidPostill
    DavidPostill over 7 years
    Welcome to Super User! This is really a comment and not an answer to the original question. You can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. Please read Why do I need 50 reputation to comment? What can I do instead?