How to configure your Windows 10 default file associations in MDT

You will first need to configure all your file associations on a test machine. Once this has been done, you will want to run the following command to export your file associations:

Dism.exe /Online /Export-DefaultAppAssociations:%USERPROFILE%\Documents\DefaultAppAssociations.xml

The XML file will be exported to your Documents folder

Now you will want to place the XML file that we just exported into your Scripts folder inside of your MDT Deployment Share.

Once that is done, launch MDT and open your deployment task sequence. Locate the PostInstall folder and add a command line task above the Inject Drivers task.


Set File Associations
Set File Associations - 2

Lets go ahead and name the task Set File Associations. In the command line field, insert the following command:

Dism.exe /Image:%OSDisk%\ /Import-DefaultAppAssociations:%SCRIPTROOT%\DefaultAppAssociations.xml

Now you’re all set!

28 Comments

  1. This only works for the administrator which initially logs on during MDT Deployment. Subsequent users logging on do not get these preferred settings. It is not across the board for all users this way. Besides, default settings are user-specific. My guess is the xml needs to be copied to a different location for it to apply to all users logging in. I did all of this. It worked for the admin but not for any users signing on after.

    • Jose Espitia

      Rich, I have been using this method for over a year and have not seen these issues. Are you sure that the user accounts that you used to logon were brand new profiles?

  2. How do you do this for in-place upgrade to windows 10?
    thanks

    • Jose Espitia

      Saeid, you will need to force the setup.exe to run a post script after the upgrade is complete. With this script, you can configure the file associations and any additional tasks that need to be completed. Feel free to contact me if you have any other questions.
      Example on how to run a post script with setup.exe:
      Setup.exe /NoReboot /ShowOobe None /Telemetry Enable /PostOOBE C:\SetupComplete.cmd

  3. Francisco Piñero

    Hi Jose, im try the Dism.exe /Image:%OSDisk%\ /Import-DefaultAppAssociations:%SCRIPTROOT%\DefaultAppAssociations.xml command but dont funcion, i see in the Microsoft page, that this change dont work with since new 1511 build. Is true, how i can solved? Thanks.

    • Jose Espitia

      I have been using this with Windows 10 1607 for over a year. Do you have DefaultAppAssociations.xml in your MDT Script folder? Please use my contact form if you have the xml file in your script folder and you are still having issues.

  4. How can I import this and the custom start menu during sysprep so that it applies to all new user logins? I’m not using MDT.

    Do I add the script in SetupComplete.cmd? What would the script look like if have the exported file in the admin documents folder or c:\?

    • Jose Espitia

      You can import the file associations using the SetupComplete.cmd but it will only affect new accounts.
      You will want to add the following line in your cmd file:
      Dism.exe /online /Import-DefaultAppAssociations:c:\DefaultAppAssociations.xml

  5. What’s the best way to do this for a SCCM task sequence?

  6. Dear,
    I am getting access denied error while running import PS command in SCCM upgrade task sequence using run powershell script step.

    any thought?

    thanks,

  7. Worked perfectly for Win10 1703, for associations. Is there a way to default the taskbar icons for all users that log in?

  8. Try powershell.exe -Executionpolicy Bypass -File pathToFile.cmd

  9. I am curious about where you inserted the task in the task sequence. In my MDT task sequence it builds the image from scratch with the OS file, then installs Applications, and then I have it do cleanup. If I run the default app task where you suggest then I am setting default associations before the programs are installed. Do you come across this problem?

    • Jose Espitia

      I normally deploy a WIM that has all of my applications already installed. However you really shouldn’t have an issue with installing the applications afterwards. The default file associations will be broken for the administrator account that MDT uses to install the applications but all other users should not experience any issues.

  10. stephanie magnuson

    When I use this it works great except with 1709, it still prompts the user to configure to:
    1. set up IE 11 on first launch (is there a way to suppress/set that as well?)
    2. Also now the 2nd time i go to launch IE it asks me how do you want to open this link and asks the user what to use (Edge/IE/Chrome/)

    • Jose Espitia

      Hi Stephanie,

      Sorry for the late response… Try the following registry keys:
      1. Suppress first launch:
      [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer\Main]
      “DisableFirstRunCustomize”= 1

      2. Suppress New App Installed Notification
      [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer]
      “NoNewAppAlert”= 1

  11. This isn’t working anymore in 1803. How to do it then?

    • Jose Espitia

      Michae,

      It should work. Are you using COPYPROFILE? This might overwrite what you import with DISM.

  12. Do you do this in your reference image or on each deployment?

    • Jose Espitia

      Mark,
      I do this in my deployment task sequence. This way I don’t have to update my WIM if I ever need to change file associations.

  13. Hi Jose,
    I’m getting “The system cannot find it the path specified” error. Any ideas why? Happy to provide more information if needed.

    • Jose Espitia

      April 2, 2019 at 6:57 pm

      Doug, when are you getting this error?

      • Hi Jose, I also get this error when applying the command. I run this as the last step before the sequence ends as I want all apps and updates to be complete before applying file associations.

        Is it because the command is expecting to still be in WinPE rather than in the actual installed Windows OS?

        • Jose Espitia

          June 1, 2020 at 6:44 pm

          Josh, yes you are getting an error because you are doing it outside of WinPE. Try the following command instead:
          dism.exe /Online /Import-DefaultAppAssociations:"C:\PATH_TO_YOUR_XML\DefaultAppAssociations.xml"

  14. Sorry I don’t understand where to do this part:
    launch MDT and open your deployment task sequence.
    Is there some other software I need installed to do this. I am trying to add this to an existing MDT drive I have. I added the file into the scripts folder.

    • Jose Espitia

      April 4, 2019 at 5:06 pm

      Hi Ben, you need to have MDT installed to add the command line action to your task sequence.

Leave a Reply