Win 10: Changing the default app for PDF files

Microsoft have apparently modified the handling of file associations in Windows 10, adding additional layers of protection for some file types in an effort to prevent file association hijacking.

A number of clients I work with have encountered issues with Edge as the default PDF viewer, namely with printing. Unfortunately, existing GPOs to modify these default app associations appear to be broken by the additional protections. Some hasty troubleshooting revealed that when the registry changes are made, a desktop notification appears to the user informing them that “An app default was reset”, and Edge is promptly reverted back to the the default app for PDF files.

It seems that Microsoft’s official method to set app associations is by generating an “AppAssociations.xml” file on a reference computer, and then applying this by group policy or directly with dism.exe. This works fine for any new users created on the system, but those with existing profiles are not affected – making this pretty useless for devices already deployed.

After some searching, I managed to piece the following together from a few different articles, which is resolving the problem when applied to our 10586 clients. I have received feedback that this doesn’t work on build 10240 though, probably because the ProgID for that build differs.

New-ItemProperty -LiteralPath 'HKCU:\SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723' -Name 'NoOpenWith' -Value '' -PropertyType String -Force -ea SilentlyContinue;
New-ItemProperty -LiteralPath 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithList' -Name 'a' -Value 'Acrobat.exe' -PropertyType String -Force -ea SilentlyContinue;
New-ItemProperty -LiteralPath 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithList' -Name 'MRUList' -Value 'a' -PropertyType String -Force -ea SilentlyContinue;
New-ItemProperty -LiteralPath 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithProgids' -Name 'Acrobat.Document.2015' -Value (New-Object Byte[] 0) -PropertyType None -Force -ea SilentlyContinue;

I found the ProgID for the current version of Edge here:

It is the first registry change above that appears to do the magic of preventing Edge from muscling back in when the other changes are made.

This is a frustrating limitation given the supposed design goals of Windows 10. File associations ought to be trivial to update by group policy, and I am sceptical of the rationale behind Microsoft’s decision to cripple this functionality.

← Installing the Novell Client from a SCCM Task Sequence
Converting OpenSUSE 11 Guest from VMWare to Hyper-V →