Microsoft Edge taking over default applications

Posted by on July 3, 2017

I’ve seen a lot of blogs and articles on Edge repeatedly taking over some default file associations.

“An app cause a problem with the default app setting for .pdf files, so it was reset to Microsoft Edge”

Yeah, thanks for that.

There are no really good ways to disable this. Most of the blogs note that you need to set a couple of registry values on Windows 10 and that stops the problem from re-occurring. The problems I have on an Enterprise Admin level, is that these solutions are very manual (sure a few of them give you some .reg key file you can import) and they make a basic assumption that some of the application versions and AppIDs will never change.

So I’ve written a little bit of PowerShell to get the AppID from the current version(s) of Edge and remove the association.

Make sure you copy it fully, the blog formatting looks like it’s truncating the commands.

Get-ItemProperty "HKCU:SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages\Microsoft.MicrosoftEdge*\microsoftedge\capabilities\fileassociations\"  | 
	Select-Object -ExpandProperty ".pdf" | 
	Foreach {
		New-ItemProperty "HKCU:Software\Classes\$_" -Name "NoOpenWith" -Value "" -Force ; 
		New-ItemProperty "HKCU:Software\Classes\$_" -Name "NoStaticDefaultVerb" -Value "" -Force 
	} | Out-Null

The above script gets the setting for every installed version of Edge where it’s been associated with .pdf extensions, and then using the AppID retrieved sets 2 registry keys to prevent it being listed in the default applications available for that file extension.

As this accesses and sets keys in the Current User registry scope, I’ve configured a GPO to run it as a logon script for all Windows 10 users.
The same keys aren’t available under the Local Machine registry hive so while I believe you can set the same keys under HKLM, you need to work out what they are from HKCU so it just seemed to make sense to set them on a per-user basis.

You should run the script BEFORE users have an issue, it won’t change the currently associated application to something else.

Tags: , , , ,

Do you have anything to say?

Powered by Wordpress and Stripes Theme Entries (RSS) | Comments (RSS)