Posted on April 20, 2017 · Posted in Group Policies, Windows 10

Managing Default File Associations in Windows 10

In Windows 8 and Windows 10 a new mechanism to manage default  file associations appeared. In this article I’ll show how to set a default browser to open HTML files, import these settings to the XML file and distribute this file containing file associations to other computers manually or using group policies (GPO).

Unlike Windows 7, in Windows 10 and Windows 8.1 user Group Policy Preferences Open With feature to manage file associations doesn’t work. But new OSs give an opportunity to export current file associations settings from the reference computer to the XML file and use this file on other computers or export it into the standard system image deployed on the clients (manually, or using WDS or SCCM).

Configure and Export File Associations in Windows 10 / 8.1

Suppose we need that Firefox browser is used to open HTML files on all domain computers. To do it, we’ll need a reference machine with the installed Firefox, on which we manually set the necessary association of file extension with the application.

Open the Control Panel and go to Control Panel -> Default Programs -> Set Default Program. Find Firefox in the list of programs and click Set this program as default. Thus, Firefox will be assigned as a default program to open all supported file types.

Set Default Program in windows 10

If you need to select specific file extensions, click Choose defaults for this program and check the desired extensions.

set program associations to file extensions

You can check the current associations for the files with the extension .html in Programs -> Default Programs -> Set Association section of the Control Panel.

set file association control panel windows 10

The computer user can export the current configuration of file associations to the XML file using DISM:

Dism.exe /online /Export-DefaultAppAssociations:C:\PS\DefaultAssoc.xml

If you open DefaultAssoc.xml in any text editor, you can see the list of file associations exported from this computer. If you need to export only a part of associations (in order not to redefine the current settings for the rest file extensions on other computers), edit the XML file manually leaving only the lines you need. For example, we’ll leave the following lines for HTM and HTML extensions:

<?xml version="1.0″ encoding="UTF-8″?>
<DefaultAssociations>
<Association Identifier=".htm" ProgId="FirefoxHTML" ApplicationName="Firefox" />
<Association Identifier=".html" ProgId="FirefoxHTML" ApplicationName="Firefox" />
</DefaultAssociations>

Dism.exe Export-DefaultAppAssociations to xml file

How to Import File Associations

This XML file can be imported into the system image on another computer online using DISM:

Dism.exe /Online /Import-DefaultAppAssociations:C:\PS\DefaultAssoc.xml

Important. These settings for mapping file extensions to programs will be applied only to new users during first logon.

You can also import these settings to the offline Windows image in the WIM or VHD file. First of all, you have to mount the image:

Dism /Mount-Image /ImageFile:C:\mnt\images\install.wim /MountDir:C:\mnt\offline

And then import the XML file:

Dism.exe /Image:C:\mnt\offline /Import-DefaultAppAssociations:\\Server1\Share\DefaultAssoc.xml

Tip. The current settings of file associations in the offline Windows image can be obtained using this command:

Dism.exe /Image:C:\mnt\offline /Get-DefaultAppAssociations

How to Distribute File Associations Using Group Policies

In Windows 8 or higher a new GPO parameter appeared that allowed to apply an XML file containing the settings of file associations to all users on a computer.

This policy called Set a default associations configuration file is located in Computer Configuration -> Administrative Templates -> Windows Components ->File Explorer.

GPO : Set a default associations configuration file

Enable the policy and specify the UNC path to the XML file. It can be located on a shared network folder, in SYSVOL directory on the domain controller or copied to the computers using GPP/ SCCM.

gpo to set file association from xml file

When working in the system, a user can reassign these associations. However, during the next logon, user settings of file associations will be reset with the settings from the XML file.

How to Reset the File Associations Settings

Using this command you can reset the settings of file associations imported earlier:

Dism.exe /Online /Remove-DefaultAppAssociations

After running this command, all new system users will log in with the default association settings (the reset has no effect on the existing users).

Previous:
Next:
Related Articles