Share via


How to associate a default program during application setup (e.g. pdf files)

Question

Wednesday, May 25, 2016 8:31 PM

In Windows 10, pdf are associated to Edge.

In my enterprise environment, I deploy both Adobe Acrobat Reader and Adobe Acrobat Pro to my users. I would like to associate pdf to the right software during setup (e.g. with PowerShell App Deployment Toolkit) for all users that already have one profile and also for the default user.
With the use of xml and dism, I will only set these default settings for new users and I can only assign software statically (only once).
What is the best practice to change file associations for existing users and new users?

All replies (5)

Thursday, May 26, 2016 8:59 AM ✅Answered

Solution found!

Some registry keys are needed:

  • Add following Keys:
Key: HKCU\SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723
Name: NoOpenWith
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithList
Name: a
Value: Acrobat.exe
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithList
Name: MRUList
Value: a
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithProgids
Name: Acrobat.Document.2015
Value: null(Byte)
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
Name: DefaultPDFFileAssociation
Value: c:\windows\system32\cmd.exe /c c:\Windows\system32\reg.exe IMPORT "c:\Windows\temp\DefaultFileAssociation.reg"

- Remove Key:

Key: HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages\Microsoft.MicrosoftEdge_25.10586.0.0_neutral__8wekyb3d8bbwe\MicrosoftEdge\Capabilities\FileAssociations
Name: .pdf
Key and Subkeys: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf

Defaultfileassociation.reg:

Windows Registry Editor Version 5.00 
;Delete the .pdf key under FileExts to clear the Microsoft Edge application association (which is the default handler for .pdf) and the UserChoice subkey. 
[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf]
;Configure the .pdf key under FileExts to set Acrobat as the default handler. 
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf] 
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithList] "a"="Acrobat.exe" "MRUList"="a" 
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithProgids] "Acrobat.Document.2015"=hex(0):
;Description: Prevents Windows 10 from resetting the file associations
;... by setting NoOpenWith registry value for all the modern apps.
;File Types: .pdf 
[HKEY_CURRENT_USER\SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723] "NoOpenWith"="" 

Friday, September 2, 2016 8:05 AM ✅Answered

Unfortunately this doesn't work anymore since Windows 10 anniversary update. The only supported way is GPO (with association.xml file) or dism command.


Thursday, May 26, 2016 6:30 AM

Hi Gaetan,

If only for the PDF, you may take a look at the thread below:

https://social.technet.microsoft.com/Forums/en-US/8ce277c5-6eee-496d-8d72-f9c97b079bf9/edge-and-default-associations-pdf-files?forum=win10itprogeneral

Consider to change the related registry using GPP settings;

For the revert back, which I consider should be caused by the Windows Update:

See information in the thread below:

http://answers.microsoft.com/en-us/windows/forum/windows_10-update/after-the-installation-of-kb3135173-a-small-set-of/27eaff6f-d373-4718-91fd-c2822d82ced5

Another thread for reference, specially for the reply from Ramesh Srinivasan :

http://answers.microsoft.com/en-us/windows/forum/windows_10-start/windows-10-default-application-association-choices/09489bb2-c995-41f9-9c30-676c9f691b82?auth=1

Regards

Please mark the reply as an answer if you find it is helpful.

If you have feedback for TechNet Support, contact [email protected]


Friday, May 27, 2016 2:42 AM

Thanks for your update and sharing.

Regards

Please mark the reply as an answer if you find it is helpful.

If you have feedback for TechNet Support, contact [email protected]


Friday, August 19, 2016 10:44 AM

Solution found!

Some registry keys are needed:

  • Add following Keys:
Key: HKCU\SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723
Name: NoOpenWith
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithList
Name: a
Value: Acrobat.exe
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithList
Name: MRUList
Value: a
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithProgids
Name: Acrobat.Document.2015
Value: null(Byte)
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
Name: DefaultPDFFileAssociation
Value: c:\windows\system32\cmd.exe /c c:\Windows\system32\reg.exe IMPORT "c:\Windows\temp\DefaultFileAssociation.reg"

- Remove Key:

Key: HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages\Microsoft.MicrosoftEdge_25.10586.0.0_neutral__8wekyb3d8bbwe\MicrosoftEdge\Capabilities\FileAssociations
Name: .pdf
Key and Subkeys: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf

Defaultfileassociation.reg:

Windows Registry Editor Version 5.00 
;Delete the .pdf key under FileExts to clear the Microsoft Edge application association (which is the default handler for .pdf) and the UserChoice subkey. 
[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf]
;Configure the .pdf key under FileExts to set Acrobat as the default handler. 
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf] 
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithList] "a"="Acrobat.exe" "MRUList"="a" 
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\OpenWithProgids] "Acrobat.Document.2015"=hex(0):
;Description: Prevents Windows 10 from resetting the file associations
;... by setting NoOpenWith registry value for all the modern apps.
;File Types: .pdf 
[HKEY_CURRENT_USER\SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723] "NoOpenWith"="" 

Registry key for Edge has been changed in Windows 10 Anniversary Update.

old: HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages\Microsoft.MicrosoftEdge_25.10586.0.0_neutral__8wekyb3d8bbwe\MicrosoftEdge\Capabilities\FileAssociations
new: HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages\Microsoft.MicrosoftEdge_38.14393.0.0_neutral__8wekyb3d8bbwe\MicrosoftEdge\Capabilities\FileAssociations

Path could be retrieved from packageid registry HKCU\Software\Classes\AppX4hxtad77fbk3jkkeerkrm0ze94wjf3s9\Shell\Open (PackageId)