I wanted to associate .php extension to sublime text editor but windows 10 was not going to make it simple..
After some googling and researching I found an answer.
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
“phpfile” this is what you need for the next part
STEP 2
Once you have the file type association that you would like to change. you will run the ftype command on it as follows
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.
Full description about the assoc command can be found here
NOTES:
If you get a response like “File association not found for extension” Then you need to create an association for that extension with the following command
assoc .(xxx)=(filetype)
example:
assoc .cls=javaclass
Once the association is created verify with command on step 1. Then you can do the the association as in step 2.