Skip to content

Commit be84c5b

Browse files
committed
feat: add a script for uninstalling all versions of Microsoft Edge on Windows 10
1 parent 334d3ea commit be84c5b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/remove_msedge.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import os, subprocess, winreg
2+
3+
app_path = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application"
4+
5+
apps = [app.path for app in os.scandir(app_path) if app.is_dir()]
6+
7+
for i in range(len(apps)):
8+
installer = apps[i] + "\\Installer"
9+
10+
if os.path.isdir(installer):
11+
setup = subprocess.Popen([installer + "\\setup.exe", "--uninstall --system-level --verbose-logging --force-uninstall"])
12+
setup.wait()
13+
14+
reg_path = "SOFTWARE\\Microsoft\\EdgeUpdate"
15+
reg = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, reg_path)
16+
winreg.SetValueEx(reg, "DoNotUpdateToEdgeWithChromium", 0, winreg.REG_DWORD, 1)
17+
18+
appx = subprocess.Popen(["powershell", "Get-AppxPackage *edge* | Remove-AppxPackage"])
19+
appx.wait()

0 commit comments

Comments
 (0)