-
-
Save ave9858/c3451d9f452389ac7607c99d45edecc6 to your computer and use it in GitHub Desktop.
# SPDX-FileCopyrightText: Copyright (c) 2023 ave9858 <[email protected]> | |
# SPDX-License-Identifier: CC0-1.0 | |
$ErrorActionPreference = "Stop" | |
$regView = [Microsoft.Win32.RegistryView]::Registry32 | |
$microsoft = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $regView). | |
OpenSubKey('SOFTWARE\Microsoft', $true) | |
$edgeUWP = "$env:SystemRoot\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe" | |
$uninstallRegKey = $microsoft.OpenSubKey('Windows\CurrentVersion\Uninstall\Microsoft Edge') | |
$uninstallString = $uninstallRegKey.GetValue('UninstallString') + ' --force-uninstall' | |
$edgeClient = $microsoft.OpenSubKey('EdgeUpdate\ClientState\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}', $true) | |
if ($null -ne $edgeClient.GetValue('experiment_control_labels')) { | |
$edgeClient.DeleteValue('experiment_control_labels') | |
} | |
$microsoft.CreateSubKey('EdgeUpdateDev').SetValue('AllowUninstall', '') | |
[void](New-Item $edgeUWP -ItemType Directory -ErrorVariable fail -ErrorAction SilentlyContinue) | |
[void](New-Item "$edgeUWP\MicrosoftEdge.exe" -ErrorAction Continue) | |
Start-Process cmd.exe "/c $uninstallString" -WindowStyle Hidden -Wait | |
[void](Remove-Item "$edgeUWP\MicrosoftEdge.exe" -ErrorAction Continue) | |
if (-not $fail) { | |
[void](Remove-Item "$edgeUWP") | |
} | |
Write-Output "Edge should now be uninstalled!" |
Thanks. How to remove Edge components in C:\Program Files (x86)\Microsoft? I have here EdgeCore, EdgeUpdate, EdgeWebView. EdgeUpdate Services still running in my system.
Thanks. How to remove Edge components in C:\Program Files (x86)\Microsoft? I have here EdgeCore, EdgeUpdate, EdgeWebView. EdgeUpdate Services still running in my system.
That's for Webview2, not the main edge browser. You should keep those files.
That's for Webview2, not the main edge browser. You should keep those files.
Hmm, in the EdgeCore folder I have fully worked Edge Browser 👀 This is normal?
Hmm, in the EdgeCore folder I have fully worked Edge Browser 👀 This is normal?
Yes, it won't run on its own. WebView2 and edge share components and you can launch the Edge UI through that folder if you manually run it.
@ave9858 microsoft didn't seem to like this script in LTSC, so they kind of made it not work anymore
i'm not sure if this fixes it
if ($edgeClient -ne $null -and $null -ne $edgeClient.GetValue('experiment_control_labels')) {
$edgeClient.DeleteValue('experiment_control_labels')
}
wat
if you get that error edge is alr gone
post on the discord if u have issues with the script
Worked flawlessly! I can even install WebView2 without Edge reinstalling!