Windows “Open With” application not appearing as an option

20

18

For some reason lately I've experienced this issue with trying to set a default application for an extension. The most common ways are the following:

  1. Right Click > Open With > Choose Default Program This opens a dialog window with the option to browse any application to use for one-time only OR (by checking the appropriate checkbox) this would effectively set the default application for the selected filetype.

  2. Control Panel\Programs\Default Programs\Set Associations This settings page allows you to set the default program for every known filetype. Just as in option #1, you select the "change program" button and from the dialog window you selected the new default application

For many windows users this is nothing new, the problem is what about when the application I want doesn't appear in the options? I even browse and find the .exe file I want and select it and still it does not appear as an option.

How do I get the application to appear as an option so that I can set it as the default application?

Xtremefaith

Posted 2014-11-17T22:36:08.493

Reputation: 671

Answers

37

After some googling I found an answer along with other forums with no sufficient answer so I thought this would make for a helpful post.

STEP 1

First you need to get the associated name of your file type. In the command prompt (be sure to run as Admin) run the following

  • assoc {filetype}

    For example:

    • assoc .php

      Should output .php=phpfile <- this is what you need for the next part

STEP 2

Once you have the filetype association that you would like to change you will run the ftype command on it

  • ftype {file_association}="absolute-path-to-application" "%1"

    For example:

    • ftype phpfile="C:\Dropbox\ST3\sublime_text.exe" "%1"

That command effectively added Sublime Text as a recommended application for phpfile type associations. Now when I use the normal windows methods for settings a default application it appears without even having to browse for it.

SUCCESS!

Full description can be found here

BONUS POINTS:

If you get a response like the following: File association not found for extention then you simply need to create an association for that extension with the following:

assoc .{XXX}={filetype}

For example:

assoc .cls=javaclass

Once the association is made which you can verify using the steps above, then you can proceed with associating it to a default application.

Xtremefaith

Posted 2014-11-17T22:36:08.493

Reputation: 671

Open to additions but currently having trouble with setting .md files to Sublime Text using this method. For some reason it won't come up as an option even though the CLI inserts appear to work fine – Xtremefaith – 2014-11-20T19:09:45.170

2Changing the handling of .scr files was only possible when the ftype command was issued in an administrator command line. – Janosch – 2017-02-03T14:10:59.260

@Janosch thank you for your comment. it's not only for .src. Xtremefaith, please add it to response - thatone should run cmd as Administrator to do that. – Line – 2017-10-12T10:44:12.533

1Good answer but seems to work only for certain programs: Those which are properly "registered" with Windows, i.e. those which show up under window-s-settings, apps, "Defaults Apps", main pane at bottom "Set defaults by app". I managed to follow the instructions above and my "bad" app now shows in the context-menu on right-click but does not open when I click on that. – Martin Zaske – 2018-10-07T12:12:55.203

Used it for .c (and .tgz) files. That Visual Studio didn't want to give them up to SublimeText (same with .cc)! All works now! I had to restart PC after given steps. – Brambor – 2018-11-21T20:41:43.723

4

TFeldt posted this solution in the Sublime Forum (link):

  1. Open
  2. Navigate to HKEY_CLASSES_ROOT\Applications\sublime_text.exe\shell\open\command Verify that the path is accurate, correct it if it is not. Exit regedit.
  3. Open task manager via ctrl+alt+del, kill explorer.exe, go to run and type explorer.exe (or skip this step and simply reboot).
  4. Now attempt the same thing, right click a text file, open with, navigate to sublime, and it should now appear in the list of available applications.

The problem that I had was that the path wasn't updated when I changed to ST3 from ST2.

Daniel Reina

Posted 2014-11-17T22:36:08.493

Reputation: 141

Step number two did it for me. The path was not valid after an update to the app. Manually editing the registry entry worked. – subjectivist – 2016-12-14T20:51:12.770

This solved my issue : I had uninstalled Notepad++ x64 and re-installed Notepad++ x32. The registry was not up to date for some reason. – François Verry – 2018-09-19T15:22:34.067

2

Thanks for all the help. I recently installed Sublime Text 3 on Windows 7 and it wasn't allowing me create certain file associations.

I had to use an elevated command prompt and the command ftype to do add the file associations.

For anyone interested in a speedy fix for common web-development files just run these commands individually (command console as administrator and from root C:):

ftype phpfile="C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"

ftype CSSfile="C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"

ftype txtfile="C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"

ftype JSFile="C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"

ftype xmlfile="C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"

The confirmation message for each should read something like this=:

phpfile="C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"

You get the idea... Now you can use these commands for any filetype and program.

Now all these filetypes should appear in the File Association (open with) dialog.

Not to drone on, but to add Sublime 3 to the right-click context menu here's a great fix that works well: http://wordpress-corner.com/add-open-sublime-text-3-windows-explorer-context-menu/

enjoypb

Posted 2014-11-17T22:36:08.493

Reputation: 21

1This duplicates another answer and adds no new content. Please don't post an answer unless you actually have something new to contribute. – DavidPostill – 2016-01-01T18:06:01.023