Microsoft changing default apps after updates

146 views
Skip to first unread message

lfr...@jameshargest.school.nz

unread,
Dec 1, 2021, 3:54:42 PM12/1/21
to Techies for schools
Have you ever noticed setting default app associations is difficult in Windows? 
Basically what I have noticed is after certain updates Edge is made the default on all files it can open. This became a problem for certain departments that want to use Adobe Acrobat Pro as the default program for pdf files. Sounds easy enough. We set the file associations via xml. All is good for a while, until an update which just reverts it to edge. Each user then has to manually change it back to acrobat. 

Microsoft is going to far with edge and forcing people to use it via very extreme methods. 
Like the W11 mess for default web browser. MS has not learnt anything from the antitrust lawsuits in the past. 

Anyway, you can solve this quite easily. REMOVE EDGE. 

I found this script which will do just that and prevents it from reinstalling. Best thing is, things work far better, files associations are back to what they were and edge never bothers them again. 


The default script installs firefox but we don't use that either so just omit that part. I've tested on W10&W11 and works excellently. 

 $AveYo = 'Paste in a PowerShell (Admin) window to uninstall Edge'  ;  function prompt {}

## RIP Edge legacy app first
$edges = (get-appxpackage -allusers *MicrosoftEdge*).PackageFullName
$bloat = (get-appxprovisionedpackage -online |? {$_.PackageName -like '*MicrosoftEdge*'}).PackageName
$users = ([wmi]"win32_userAccount.Domain='$env:userdomain',Name='$env:username'").SID,'S-1-5-18'
$eoled = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife'
foreach ($legacy in $bloat) {
  foreach ($user in $users) { ni "$eoled\$user\$legacy" –Force -ea 0 >$null }
  powershell -nop -c remove-appxprovisionedpackage -online -packagename $legacy 2>&1 >$null
}
foreach ($legacy in $edges) {
  foreach ($user in $users) { ni "$eoled\$user\$legacy" –Force -ea 0 >$null }
  powershell -nop -c remove-appxpackage -allusers -package $legacy 2>&1 >$null
}

## remove ChrEdge lame uninstall block
$uninstall = '\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge'
foreach ($wow in '','\Wow6432Node') {'HKCU:','HKLM:' |% { rp $($_ + $wow + $uninstall) NoRemove -Force -ea 0 } }

## find all ChrEdge setup.exe
$setup = @(); "LocalApplicationData","ProgramFilesX86","ProgramFiles" |% {
  $setup += dir $([Environment]::GetFolderPath($_) +'\Microsoft\Edge*\setup.exe') -rec -ea 0
}

## compute ChrEdge uninstall arguments
$arg = @(); $u = '--uninstall'; $v = ' --verbose-logging --force-uninstall --delete-profile'
foreach ($l in '',' --system-level'){ foreach ($m in ' --msedge',''){ if ($m -eq ''){$arg += $u + $l + $v} else {
  '-beta','-dev','-internal','-sxs','webview','' |% {$arg += $u + $l + $m + $_ + $v} } }
}

## brute-run found ChrEdge setup.exe with uninstall args
foreach ($ChrEdge in $setup){ foreach ($purge in $arg) { powershell -nop -c "start '$ChrEdge' -args '$purge'" 2>&1 >$null } }

## remove leftover shortcuts
$IELaunch = '\Microsoft\Internet Explorer\Quick Launch'
del $([Environment]::GetFolderPath('Desktop') + '\Microsoft Edge*.lnk') -Force -ea 0 >$null
del $([Environment]::GetFolderPath('ApplicationData') + $IELaunch + '\Microsoft Edge*.lnk') -Force -ea 0 >$null
del $($env:SystemRoot+'\System32\config\systemprofile\AppData\Roaming' + $IELaunch + '\Microsoft Edge*.lnk') -Force -ea 0 >$null

## prevent reinstall via windows updates - ms will probably "accidentally" break this often
ni "HKLM:\SOFTWARE\Microsoft\EdgeUpdate" -Force -ea 0 >$null
sp "HKLM:\SOFTWARE\Microsoft\EdgeUpdate" DoNotUpdateToEdgeWithChromium 1 -Type Dword -ea 0

## AveYo: open start menu search in default browser (firefox vivaldi etc)
new-psdrive -name HKCR -PSProvider Registry -root HKEY_CLASSES_ROOT -ea 0 >$null
ri 'HKCR:\microsoft-edge' -Recur -Force -ea 0
'DefaultIcon','shell\open\command' |% { ni "HKCR:\microsoft-edge\$_" -Force -ea 0 >$null }
sp 'HKCR:\microsoft-edge' "URL Protocol" "" -Force -ea 0
sp 'HKCR:\microsoft-edge' -Name '(Default)' -Value 'microsoft-edge:' -Force -ea 0
sp 'HKCR:\microsoft-edge\DefaultIcon' -Name '(Default)' -Value 'url.dll,5' -Force -ea 0
$command = "[diagnostics.process]::start([uri]::unescapedatastring('%1'.split('=',3)[-1]))"
sp 'HKCR:\microsoft-edge\shell\open\command' -Name '(Default)' -Value "powershell.exe -nop -win 1 -c $command" -Force -ea 0

## refresh explorer
kill -name 'sihost'


Andrew Godfrey

unread,
Dec 1, 2021, 5:10:54 PM12/1/21
to techies-f...@googlegroups.com
As far as the default pdf reader goes, we have recently noticed staff device defaults changing from Adobe Reader to PDFBinder which was probably caused by an Adobe update causing the old association to be dropped and then Windows changing to the next one on the list.

Pretty easy fix to reassociate for the end user.

Andrew Godfrey | Network Manager




--
You received this message because you are subscribed to the Google Groups "Techies for schools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to techies-for-sch...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/techies-for-schools/bb6bdf55-5476-4c02-9686-aedb7d6e78d8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages