Configuring file associations in Windows 8.1

When you are using Windows 8.1 (or Windows 8, which behaves the same way), you may notice that some file types (mapped by file extension) are opened by modern apps while others may be opened by desktop apps.  If you are a tablet user, you may not want the desktop apps; if you are a laptop or desktop user without a touch screen, you may not want the modern apps.

Fortunately, you can configure these mappings fairly easily through the PC Settings application by navigating to “Search and Apps” then “Defaults”, then click the “Choose default apps by file type” link at the bottom of the page to get to the full list of file extensions:


In this particular example, the .PDF extension is mapped to the modern Reader app, but if you click on the Reader icon you can choose from available apps:


For a desktop or non-touch laptop, you might want to choose Adobe Reader instead.  And you might make similar changes for MP3 and MP4 files, changing them from the default of “Music” and “Video”:


to instead use Windows Media Player:


You get the point:  Go through each mapping and select desktop apps for non-touch machines, modern apps for tablets and other touch-enabled computers.  (You likely won’t be able to completely make the switch from modern to desktop apps, as there are more file types supported by the newer modern apps.  But you can get close.)

Obviously configuring all of those app mappings by hand isn’t something you want to do on thousands of machines.  With previous OS releases, you needed to poke in the necessary registry entries (or carefully install apps in the correct order) to get the mappings you wanted – it worked, but it wasn’t much fun.  Starting with Windows 8, there is an easier way to do this using DISM.EXE.  Configure the mappings by hand once, then export them:


The resulting XML file has one line for each association:


And you can import them the same way:


So imagine that you need to support both touch (tablet and laptop) and non-touch systems in your environment.  You can set up a step in a deployment task sequence that conditionally imports the appropriate file mappings:


The real key here is how to make those steps conditional.  That part is a little trickier.  Fortunately, MDT 2013 (and MDT 2012 Update 1) includes an executable, IsTouchEnabled.exe, that will help.  You can add it into the task sequence to set a variable that can then be used as a condition in a subsequent step.  The end result is something that looks like this:


The first step runs IsTouchEnabled.exe and is set to continue on error (because it reports a return code of 1 if touch is enabled):


(Make sure you click the “Continue on error” checkbox on the Options tab.)  The next step then sets an IsTouchEnabled task sequence variable only if the previous step sets a return code of 1:



Then the next two steps are configured with appropriate conditions:



As always, a few notes:

  • When DISM imports these file associations, it modified the default user profile.  So any users (e.g. the local Administrator account) that already existed before the DISM command was executed will continue to have the associations that were in the OS image.
  • Why does MDT include the IsTouchEnabled executable but doesn’t use it by default?  Well, it does actually use it, but only in UDI scenarios.  This is actually a .NET application that asks Windows if it supports digitizers (by calling the GetSystemMetrics API).
  • Why not have ZTIGather set a variable using the same executable?  Then I’d have to write a script 🙂  That’s overkill in this particular case, but feel free to do it if you like neat-and-tidy.
  • What happens if an app you specified isn’t present?  Not sure, try it out yourself 🙂

You can read more about these DISM command line options at

Comments (16)
  1. Anonymous says:

    excelent post 🙂

  2. The question is whether the GetSystemMetricsEx API call behaves the same in Windows PE – I haven’t tried that myself to see, as I don’t typically have .NET Framework in Windows PE.

  3. I haven’t tried it, but my guess is that it won’t work in Windows PE.

  4. Kamikaze-Steve says:

    I used this to try to modify the association of .PDF from Adobe Reader to Foxit Reader and .LOG from Notepad to CMTrace. I also added an association for a mailto: URL to point to Outlook. The mailto change worked, but the other two associations didn’t
    change. Here’s what the XML looks like:

    Any suggestions?
    (BTW, that’s how Foxit registers itself. )

  5. Kamikaze-Steve says:

    Ignore my question. I found 2 things. 1, you can’t post XML in a question. 🙂 and 2, you have to set the policy to import the associations.

  6. Hollanders Rens says:

    Great post, thank you for explaining!

  7. Anonymous says:

    Pingback from Blog Post: Configuring file associations in Win…

  8. Haecki says:

    Thanks Michael for this useful post 🙂

  9. Dustin Hedges says:

    Hi Michael, Great blog post! I have a question on the IsTouchEnabled.exe utility. Will this work within WindowsPE by any chance?

  10. Anon1 says:

    I can use touch on touch-enabled laptops when in WinPE based on Win8 Kernel. Why would isTouchEnabled.exe not return the exact same exitcode as it does under Full OS? Is the object that isTouchEnabled.exe enumerates under WinPE not the same as when in Full OS?

  11. Pierre says:

    I want to save doc, docx, xls, xlsx associations, I don’t see them in the file on your article. Is it a way to do this ?


  12. tom says:

    How did you get to the first page you displayed? I don’t see a “navigating” key on this keyboard.

  13. csmeeton says:

    Can you help me? I have a Dell Inspiron 3147 touchscreen PC running Windows 8.1 and I’d like to email photos without having to attach them manually. Every time I press "send to" from a photo, I get an error msg indicating that I don’t have a default mail
    program installed, which I do=Windows Mail App. So, why won’t the Windows Mail App automatically send out my photos? I have it set as my default mail program.

  14. MikZ says:

    Nice, but it’d be helpful if those complicated commands were text instead of images, so we can copy and paste them (assuming the clipboard has survived the Windows dumbing-down razor gang).

  15. Karl says:

    by the way this does not work if you don’t set the copyprofile=true option when you deploy with mdt or sccm. i tried both with no luck. in fact, to get the file associations set for each new user that logs on you have to run this every time a user logs
    on for the first time. maybe someone else has a solution, since i have been advised not to set the copyprofile=true.

Comments are closed.

Skip to main content