Skip to content

Instantly share code, notes, and snippets.

@ave9858
Last active April 1, 2025 09:00
Show Gist options
  • Save ave9858/c3451d9f452389ac7607c99d45edecc6 to your computer and use it in GitHub Desktop.
Save ave9858/c3451d9f452389ac7607c99d45edecc6 to your computer and use it in GitHub Desktop.

Uninstall Microsoft Edge

Important

Working on the latest supported Windows versions. Run Windows Update before following this guide.

1. Open Powershell > RUN AS ADMIN

2. Paste in irm https://gist.github.com/ave9858/c3451d9f452389ac7607c99d45edecc6/raw/UninstallEdge.ps1 | iex and press enter

3. Microsoft Edge will be completely uninstalled.

Note

The Microsoft Edge Update service might remain, this is normal as it is required for updating WebView2.

# 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')
if ($null -eq $uninstallRegKey) {
Write-Error "Edge is not installed!"
}
$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!"
@maolop
Copy link

maolop commented Apr 5, 2023

DONT FORGET TO REMOVE THE MICROSOFT EDGE REGISTRY KEY AFTERWARDS OR ELSE YOU WILL WASTE MANY HOURS OF YOUR LIFE FIXING WINDOWS UPDATE!!!!!!!!!!!!

Please explain.

@ave9858
Copy link
Author

ave9858 commented Apr 5, 2023

Follow all steps of the guide, don't quit when edge has disappeared.

DONT FORGET TO REMOVE THE MICROSOFT EDGE REGISTRY KEY AFTERWARDS OR ELSE YOU WILL WASTE MANY HOURS OF YOUR LIFE FIXING WINDOWS UPDATE!!!!!!!!!!!!

Please explain.

@Melodeiro
Copy link

God bless you

Copy link

ghost commented Jul 10, 2023

wow it works with that strange appx-remove trick...
.md -> SOFTWARE\WOW6432Node\Microsoft
.ps1 -> SOFTWARE\Microsoft
why they differ?
thanks...

@ave9858
Copy link
Author

ave9858 commented Jul 10, 2023

wow it works with that strange appx-remove trick...
.md -> SOFTWARE\WOW6432Node\Microsoft
.ps1 -> SOFTWARE\Microsoft
why they differ?
thanks...

The script selects the 32 bit registry automatically ($regView = [Microsoft.Win32.RegistryView]::Registry32), while the guide uses regedit so you have to navigate to it manually.

@he3als
Copy link

he3als commented Jul 10, 2023

Wouldn't it also make sense to remove it with DISM (so that new users don't have the AppX)?

Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -like "*Microsoft.MicrosoftEdge*" } | Remove-AppxProvisionedPackage -Online

@ave9858
Copy link
Author

ave9858 commented Jul 10, 2023

Wouldn't it also make sense to remove it with DISM?

Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -like "*Microsoft.MicrosoftEdge*" } | Remove-AppxProvisionedPackage -Online

That's not necessary, and I'm not sure if it work because edge legacy is a system app, not a regular app preinstalled.

@he3als
Copy link

he3als commented Jul 10, 2023

Why would it not be necessary? It still stays as a provisioned package after you uninstall it.

vmware_CguRfYzb4a
vmware_OxfiqYSKHv

@ave9858
Copy link
Author

ave9858 commented Jul 10, 2023

Why would it not be necessary? It still stays as a provisioned package after you uninstall it.

vmware_CguRfYzb4a vmware_OxfiqYSKHv

That's not edge legacy, do you see that on the system at all with new users (outside of when you search for it in PowerShell or whatever)? That app should be removed when you uninstall Edge chromium.

@he3als
Copy link

he3als commented Jul 10, 2023

It seems like Edge uninstalled incorrectly in my VM, after re-running the script the package seems to disappear, sorry about that.

Copy link

ghost commented Aug 20, 2023

The script selects the 32 bit registry automatically ($regView = [Microsoft.Win32.RegistryView]::Registry32), while the guide uses regedit so you have to navigate to it manually.

very nice

@Laicure
Copy link

Laicure commented Sep 1, 2023

Worked flawlessly! I can even install WebView2 without Edge reinstalling!

@GeniusBroccoli
Copy link

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.

@ave9858
Copy link
Author

ave9858 commented Apr 4, 2024

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.

@GeniusBroccoli
Copy link

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?

@ave9858
Copy link
Author

ave9858 commented Apr 4, 2024

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
Copy link
Author

ave9858 commented Sep 29, 2024

wat

@ave9858
Copy link
Author

ave9858 commented Sep 29, 2024

if you get that error edge is alr gone

@ave9858
Copy link
Author

ave9858 commented Sep 29, 2024

post on the discord if u have issues with the script

@InternetNinjo
Copy link

InternetNinjo commented Sep 30, 2024 via email

@ClashFlash
Copy link

I'm getting an error even after following the guide, please explain.

Screenshot 2024-12-06 182123

@ave9858
Copy link
Author

ave9858 commented Dec 6, 2024

I'm getting an error even after following the guide, please explain.
Screenshot 2024-12-06 182123

That error happens when Edge is already uninstalled, can you show screenshot of edge on your system?

@ClashFlash
Copy link

ClashFlash commented Dec 6, 2024

I'm getting an error even after following the guide, please explain.
Screenshot 2024-12-06 182123

That error happens when Edge is already uninstalled, can you show screenshot of edge on your system?

Here's the screenshot
image
image

@ave9858
Copy link
Author

ave9858 commented Dec 6, 2024

Does it show up in Control Panel?

@ClashFlash
Copy link

Does it show up in Control Panel?

Yes, in control panel and apps and features
image

@ave9858
Copy link
Author

ave9858 commented Dec 7, 2024

Are you able to just manually uninstall? Can you try repairing and then attempting uninstall again?

@ClashFlash
Copy link

Are you able to just manually uninstall? Can you try repairing and then attempting uninstall again?

There is no option to manually uninstall. In control panel it can only be repaired and it requires "MicrosoftEdgeEnterprisex64.msi" to actually repair it, even if say I deleted the edge folders manually it will attempt to restore it in the next security patch.

@ave9858
Copy link
Author

ave9858 commented Dec 8, 2024

You installed MSI version of edge, checking how best to remove that. you can download the msi from https://www.microsoft.com/en-us/edge/business/download

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment