You are on page 1of 1

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.

### Examples ###

:\Windows\system32>assoc .tex=texfile
.tex=texfile

C:\Windows\system32>ftype texfile="C:\Program Files\Sublime Text


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

C:\Windows\system32>assoc .R=R
.R=R

C:\Windows\system32>ftype R="C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"


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

C:\Windows\system32>

You might also like