Windows 10 won't let me set default apps for file extensions
It is possible to add a new file association directly to the registry when the Windows interface does not work for new extensions:
- Start regedit and click on
HKEY_CLASSES_ROOT
- Right-click on
HKEY_CLASSES_ROOT
and chooseNew
and thenKey
. - Name the key according to the file extension, e.g.
.ext
. (If exists already, skip this step.) - Set the default value of the key you just created to some unused unique name,
e.g.
MyFileType
. (If set already, skip this step.) - Repeat the above to create another new key with the above name, e.g.
MyFileType
. (If exists already, skip this step.) - Set the default value of this key to the name of the file type, e.g.
File Type name
. - Right-click
MyFileType
and create a new subkey namedDefaultIcon
. - Set the new key's default value to
C:\path-to\executable,0
using the executable that is to handle the request. Pick another executable if yours does not contain icon resources. (0
is the index of the icon within the executable.) - Create another new key and call it
shell
. - For each verb/action you'd like to associate, create a new sub key with the desired name. Some verbs are preset and will automatically use localized names, e.g.
open
,edit
orprint
. - For each verb create a sub key
command
and set its default value to the program to be run. Also make sure to include all parameters needed, adding quotes if there are spaces inside, e.g."C:\My Path\My Program.exe" "%1"
.%1
will be replaced with the actual file name picked for this action.
For instance, here's a sample registry file to create an association between .txt files and EmEditor:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.txt] @="emeditor.txt" [HKEY_CLASSES_ROOT\emeditor.txt] @="Text Document" [HKEY_CLASSES_ROOT\emeditor.txt\DefaultIcon] @="%SystemRoot%\\SysWow64\\imageres.dll,-102" [HKEY_CLASSES_ROOT\emeditor.txt\shell] [HKEY_CLASSES_ROOT\emeditor.txt\shell\open] [HKEY_CLASSES_ROOT\emeditor.txt\shell\open\command] @="\"C:\\Program Files\\EmEditor\\EMEDITOR.EXE\" \"%1\"" [HKEY_CLASSES_ROOT\emeditor.txt\shell\print] [HKEY_CLASSES_ROOT\emeditor.txt\shell\print\command] @="\"C:\\Program Files\\EmEditor\\EMEDITOR.EXE\" /p \"%1\""
Windows 10 patch KB4467682
Addresses an issue that prevents some users from setting Win32 program defaults for certain app and file type combinations using the Open with… command or Settings > Apps > Default apps.
I can confirm that this recent patch fixes the issue. Just update Windows 10 and it should work again