User file type associations (FTA’s) in Windows 10

< Terug naar blog overzicht

Microsoft has come a long way in enhancing the user experience on their Operating Systems partially by enhancing and enriching the overall user experience and partially by simplifying a lot of tasks which can now be (easily) executed by the end user. This usually is great for home users and users who only use one device like a laptop or desktop with a local profile, but can turn into an IT headache if all these personal user settings need to be roamed.

One of the things I recently ran into was user file type associations (FTA’s) in a Citrix XenApp (Windows Server 2016) and XenDesktop(Windows 10) environment.

Users where allowed to choose their own default program for applications used  for web browsing and PDF handling among others.

If users are able to change these settings they expect these settings to persist and be roamed to each new session.

In Window 7, server 2008 R2 and XenApp 6.x these settings where saved in the registry for the user in the key FileExts for each particular file extension (e.g. .PDF and  .DOCX). Saving these settings and reapplying these at next logon did the trick.

Things changed with Windows 8.1 and server 2012 R2 (and consequently Windows 10 and Windows Server 2016). The previous method didn´t work anymore. Searching for a solution I stumbled upon a great article by James Rankin with a detailed explanation of the changesand technical details (http://www.htguk.com/deploying-per-user-file-type/) which is a great read!

What it comes down to is, if you change a filetype by using Default Programs or through Open Withthe registry key in FileExts still changes but additionally a value called Hash is created. The data in this value is a hash generated from the application, the computer name and username. Roaming this registry key to another server or desktop still prompts you to choose the default program again, because the hash doesn´t match.

To get things to work there are three main registry locations regarding FTAs (xxx being the filetype extension)

 

  1. HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xxx
  2. HKEY_CURRENT_USER\SOFTWARE\Classes\.xxx
  3. HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xxx

 

Enforcing a particular FTA is fairly easy to achieve by specifying the correct file type handler in key 2 and removing keys 1 (requires elevated rights!) and 3.

Setting and roaming a user defined FTA requires a lot more configuring (and testing). The workflow  for capturing and reapplying these settings is:

 

Logoff:

  • Check if the user had changed the FTA by checking if the value “ProgId” exists in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xxx\UserChoice

 

If the FTA has changed:

 

  • Copy HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xxx \UserChoice\ProgId to HKCU:\Software\Classes\. xxx (Default)
  • Hive out the value from HKCU\Software\Classes\. xxx to a file
  • Delete HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xxx
  • Delete HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xxx(requires elevated rights!)

 

Logon:

  • Delete HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xxx
  • Delete HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xxx (requires elevated rights!)
  • Hive in the value for HKCU\Software\Classes\. Xxxhived out during logoff to a file

 

If Windows 10 or Windows Server 2016 is used then the key HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xxx\UserChoice needs to be deleted Post-logon

 

Catches:

This needs to be tested for every single application of which you want to capture the user defined FTA because results may vary for each application (keep things in mind like timing and application registering). And Modern Apps that have FTAs (like Edge, Photos and Videos) need to be removed to use this method.

If you need more help…….

Mike Cobussen (Workspace Specialist)

Meer nieuws

Meer weten?

Laat uw gegevens achter en wij zullen zo snel mogelijk contact met u opnemen om uw vragen te beantwoorden.