How to Export and Import File Associations in Windows 10

Once you have installed your favorite apps in Windows 10 and associated file types with those favorite apps, you want them to stay that way. However Windows 10 sometimes resets them to Microsoft-recommended defaults. You might find it useful to export your preferences to a file. That way, you can later restore them in a new user account or after a new build of Windows 10 installs. Let's see how it can be done.


Windows 10 allows you to export your current file associations using the built-in DISM tool. It will store them in an XML file, which can be imported later using DISM. You need to do the following.

Export File Associations in Windows 10
Here I assume that you have all the required apps installed and already set with their file associations.

  1. Open an elevated command prompt.
  2. Type or paste the following command and press Enter:
    dism /online /Export-DefaultAppAssociations:"%UserProfile%\Desktop\FileAssociations.xml"

    This will export your current file associations to the file FileAssociations.xml and put it in your Desktop folder.

    You can correct the file path if required. The command will produce the following output: export-file-associations

That's it. You just exported your file associations to a file. exported-file-associations

Import File Associations in Windows 10
You can restore your file associations in a new user account that you have just created. Or, if you have re-installed or upgraded Windows 10 to a newer build and your file associations got reset, you can save your time and import the file associations from the earlier saved file. Do it as follows.

  1. Open an elevated command prompt.
  2. Type or paste the following command and press Enter:
    dism /online /Import-DefaultAppAssociations:"%UserProfile%\Desktop\FileAssociations.xml"

    This will restore your current file associations from the file FileAssociations.xml. You need to correct the file path to match the location you store it in. The command will produce the following output: import-file-associations

Tip: if you decide to revert the changes made by the imported file associations file, you can run the following command from the elevated command prompt:

Dism.exe /Online /Remove-DefaultAppAssociations

This will remove any custom file associations that you imported and restore the previous configuration set.

That's it.

7 thoughts on “How to Export and Import File Associations in Windows 10

  1. MDJ

    It failed: http://i.imgur.com/KFJBkG0.png

    Here’s the end of the log file:

    2016-10-03 20:42:11, Info DISM DISM Provider Store: PID=2888 TID=1372 Getting Provider AssocManager – CDISMProviderStore::GetProvider
    2016-10-03 20:42:11, Info DISM DISM Provider Store: PID=2888 TID=1372 Provider has previously been initialized. Returning the existing instance. – CDISMProviderStore::Internal_GetProvider
    2016-10-03 20:42:11, Info DISM DISM Assoc Provider: PID=2888 TID=1372 Routing the command… – CAssocManager::ExecuteCmdLine
    2016-10-03 20:42:13, Error DISM DISM.EXE: AssocManager processed the command line but failed. HRESULT=800706BE
    2016-10-03 20:42:13, Error DISM DISM Manager: PID=2208 TID=4888 Failed to get the IDismImage instance from the image session – CDISMManager::CloseImageSession(hr:0x800706ba)
    2016-10-03 20:42:13, Error DISM DISM.EXE: – CDismWrapper::CloseSession(hr:0x800706ba)
    2016-10-03 20:42:13, Info DISM DISM.EXE:
    2016-10-03 20:42:13, Info DISM DISM.EXE:
    2016-10-03 20:42:13, Info DISM DISM.EXE:
    2016-10-03 20:42:13, Info DISM DISM Provider Store: PID=2208 TID=4888 Found the OSServices. Waiting to finalize it until all other providers are unloaded. – CDISMProviderStore::Final_OnDisconnect
    2016-10-03 20:42:13, Info DISM DISM Provider Store: PID=2208 TID=4888 Disconnecting Provider: FolderManager – CDISMProviderStore::Internal_DisconnectProvider
    2016-10-03 20:42:13, Info DISM DISM Provider Store: PID=2208 TID=4888 Releasing the local reference to DISMLogger. Stop logging. – CDISMProviderStore::Internal_DisconnectProvider
    2016-10-03 20:42:13, Error DISM PID=2208 TID=4888 Failed to get the IDismImage instance from the image session – CDISMManager::CloseImageSession(hr:0x800706ba)
    2016-10-03 20:42:13, Error DISM PID=2208 TID=4888 An error occured closing an open image session during cleanup. HR=0x800706ba – CDISMManager::FinalRelease

    Reply
    1. Sergey Tkachenko Post author

      This usually is happening when there is a lock, on a file, that is blocking the scan from happening.

      Reply
      1. MDJ

        What kind of lock and on which file?

        Reply
        1. Sergey Tkachenko Post author

          Can you upload the whole log to the pastebin?

          Reply
  2. Sylvain

    Importing associations works only for the upcoming new users you create – ie. It does not change the associations of the CURRENT user; it changes the defaults which will be loaded into NEW users you create after importing…

    Regards,

    Reply
  3. DKO

    May I ask if there is a way to Export (backup) current file extensions for current user and to be able to Import (restore) them for CURRENT User when necessary or desired.

    Such ability would be extremely valuable because not only dose MS change associations at times but some applications when installed or updated also have an undesired habit of changing file associations (not always obviously easy/possible/obvious how to avoid by Users when installing.

    Many thanks

    Reply
  4. Aras

    Sylvain is right. You cannot apply saved associations to current user. They are applied to default user profile.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.