Set default file association of PDF to Adobe Reader

Hello guys,

i’ve tryed to modify the default app for open the pdf file. i’ve tried with this command but it doesn’t function.

[scriptblock]$HKCURegistrySettings = {
        # Set the Progid value to "AcroExch.Document.DC" to associate PDF files with Adobe Acrobat
		Set-RegistryKey -Key "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice" -Name "Progid" -Value "AcroExch.Document.DC" -SID $UserProfile.SID
 		}
		Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings

Anyone have an idea?

Thank you?

I can see two issues potentially.
The Set-RegistryKey command may be wrong - Review this:

  1. Unless it is a formatting issue on the code examples on the web page - It appears you do not require the : in the Key
  2. Also you are missing a \ before .pdf (after \FileExts) in your command

Try this:

[scriptblock]$HKCURegistrySettings = {
# Set the Progid value to "AcroExch.Document.DC" to associate PDF files with Adobe Acrobat
Set-RegistryKey -Key "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice" -Name "Progid" -Value "AcroExch.Document.DC" -SID $UserProfile.SID
}
Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $HKCURegistrySettings
1 Like

Alas, the days of using the registry to set file associations are gone.
Microsoft put an end to it and now you have to fight Edge to stop showing PDF files.

you cannot set \Userchoice\ in HKCU easily.
There are many workarounds.
Home users need to learn how to manually set file associations.

Sysadmins do one of more of the convoluted methods described here:
Changing Default File Associations in Windows 10 and 11 | Windows OS Hub (woshub.com)

@sintaxasn, this would be an excellent new function to add to PSADT.

2 Likes

Hello guys,

In fact, I ran into a problem some time ago and remember that I eventually had to abandon the idea precisely because Microsoft did not allow the change. So in the end I had to insert a rule in the image deployment process before the user logged on to the PC.

thank you for your precious help

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.