Windows “Open With” application not appearing as an option
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.
TFeldt posted this solution in the Sublime Forum (link):
- Open
- 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.
- Open task manager via ctrl+alt+del, kill explorer.exe, go to run and type explorer.exe (or skip this step and simply reboot).
- 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.
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/