Before Windows 10, an application could check default apps, ask for user consent and set default app programmatically using a Windows API. The problem with the previous sentence is the word could. The application should have checked it, should have asked it and then changed it. But some programs skip the user consent and set the app defaults into the registry.
The way that default file associations work changed in Windows 10.
File association changes in Windows 10
There is a new UI for the end-user. This new way puts the user in control with a new file association notification. This notification will be displayed:
- On the first launch of a file extension, if multiples programs are registered for handling that file extension.
- Each time a new application registers a file extension, except if the Always use this app to open .xxx files is checked.
If an application used Windows API to set default apps, the user will receive the following notification:
Windows 10: An app default was reset
But what happens if an application is not using Windows API and writes some stuff and hijacks user preferences?
Windows 10 detects that the registry is corrupted and will reset the default program for this file extension. Additionally, the end-user will receive this notification: An App default was reset. These change is documented in KB4001770: Reset app default when a registry setting is deleted or corrupted and streamlined notification about the corruption.
If you are using applications or scripts that tamper registry entries to configure default apps associations, you will also get app reset notifications.
How to configure file association in Windows 10?
It’s possible to configure or force default association using supported methods.
The easiest way to do it is to set up a reference computer, install applications, configure default programs and use Dism to export/import the custom default app associations or use a group policy.
- Set up a reference computer
- Install applications
Go to Control Panel\All Control Panel Items\Default Programs and configure default apps associations. In Windows 10 1709, this control panel item is now in Settings app.
- Export/import the custom default app association with dism.exe
Note that you need administrator rights to use dism.exe. And to export properly the associations use the same account used in step 3, otherwise you will get a malformed XML file.
- Enter the following command:
Dism.exe /online /export-defaultappassociations:C:\CustomFileAssoc.xml
If you want to import your file with DISM.exe, DO NOT delete any file associations entries! A missing entry will trigger the App default reset notification and you will get a notification storm at the first logon.
To import the xml on another computer use:
Dism.exe /online /import-defaultappassociations:c:\CustomFileAssoc.xml
Disappointed? Yeah, me to. This means that you will have to fiddle on a pc where the application is installed or do the installation on a different pc just to set an extension default. And to make it worse, this method will overwrite every association. You will need to import your latest version before you can add one extension in your network.
Force only some file associations. You will probably wonder why I’ve let you read method A. The answer will make you a little bit sad it bet. It’s actually not possible.
What you can do is make an export of a default Windows 10 reference pc and mark it as CustomFileAssoc.xml and a second xml with just the extensions you want to change. You will have to edit the .xml file manually. This second file will have to be assigned to the pc with a GPO. You will find the policy setting under Windows Components\File Explorer with the name ‘Set a default associations configuration file’.
At logon Explorer.exe will process both xml files.
Not every change is an improvement…