Compare commits

..

14 commits

Author SHA1 Message Date
Sean
f57ed2b7dc
Update README.md 2023-06-23 09:28:35 -05:00
Sean
0341c97fb4
Update README.md 2023-06-23 09:27:32 -05:00
Sean
2d61c7586d
Update README.md 2023-06-23 09:26:54 -05:00
Sean
e82782326b
Update README.md
Added flag options
2023-06-08 12:08:28 -05:00
Sean
23a8bd1c73
Added /s silent flag 2023-06-08 12:01:15 -05:00
Sean
7792329bd2
Added /flags
/s  Silent        - Do not print anything or change title of window
/e  Edge only - Do not remove WebView
2023-06-08 11:58:16 -05:00
Sean
cce5c84849
Delete Remove.py 2023-06-08 11:57:52 -05:00
Sean
9b19d775f5
Added /flags
/s  Silent        - Do not print anything or change title of window
/e  Edge only - Do not remove WebView
2023-06-08 11:57:13 -05:00
Sean
7b108c98ce
Added /flags
/s  Silent        - Do not print anything or change title of window
/e  Edge only - Do not remove WebView
2023-06-08 11:56:17 -05:00
Sean
9de9c9704e
Update gui.py
Fixed - Hide cmd opening/flashing when deleting tasks
2023-06-01 23:55:02 -05:00
Sean
126712d350
Updated
Fixed - Hide cmd opening/flashing when deleting tasks
2023-06-01 23:54:28 -05:00
Sean
bba8a87b17
Update gui.py
Fixed - cmd opening/flashing when executing code
2023-06-01 23:43:32 -05:00
Sean
3ac1a3134a
Updated
Fixed - cmd opening/flashing when executing code
2023-06-01 23:42:08 -05:00
Sean
3d8ae20f7a
Update README.md
Moved reinstall links above image
2023-05-25 22:20:08 -05:00
6 changed files with 109 additions and 57 deletions

View file

@ -1,18 +1,39 @@
<a href="https://www.buymeacoffee.com/wic8pmtmys" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Piza" height="36" width="120"></a>
**Microsoft Edge / Edge WebView uninstallers**
```diff
! WARNING
Removal of Edge will cause update "KB5006670" to repeatedly fail/rollback.
Removal of Edge will cause update "KB5006670" (2021) to repeatedly fail/rollback.
Install Edge, run Windows Updates, then remove Edge
****************************************************************************************
Remove-Edge.exe Remove-EdgeOnly.exe flags
/s Silent Do not print anything, or change title of window
/e Edge Only Do not remove WebView
```
<br>
[Remove-Edge.bat](https://github.com/ShadowWhisperer/Remove-MS-Edge/blob/main/Remove-Edge.bat) Some versions of Edge will not work with this. (Not updated) *Chrome version only
[Remove-Edge.exe](https://github.com/ShadowWhisperer/Remove-MS-Edge/blob/main/Remove-Edge.exe) Full uninstaller
[Remove-EdgeOnly.exe](https://github.com/ShadowWhisperer/Remove-MS-Edge/blob/main/Remove-EdgeOnly.exe) Does not remove WebView.
[Remove-Edge_GUI.exe](https://github.com/ShadowWhisperer/Remove-MS-Edge/blob/main/Remove-Edge_GUI.exe) Full uninstaller with interface (option to omit WebView)
[_Source](https://github.com/ShadowWhisperer/Remove-MS-Edge/tree/main/_Source) contains the python script used in the executable file. [Setup.exe](https://www.virustotal.com/gui/file/4963532e63884a66ecee0386475ee423ae7f7af8a6c6d160cf1237d085adf05e) was pulled from an Edge intall.
<br>
![alt text](https://github.com/ShadowWhisperer/Remove-MS-Edge/blob/main/_Source/Screenshot_GUI.PNG?raw=true)
[_Source](https://github.com/ShadowWhisperer/Remove-MS-Edge/tree/main/_Source) contains the python script used in the executable file. [Setup.exe](https://www.virustotal.com/gui/file/4963532e63884a66ecee0386475ee423ae7f7af8a6c6d160cf1237d085adf05e) was pulled from an Edge install.
Edge Installers: [Small DL](https://www.microsoft.com/en-us/edge/download?form=MA13FJ) / [Full DL](https://www.microsoft.com/en-us/edge/business/download?form=MA13FJ)
<br>
Re-Install Edge: [Small DL](https://www.microsoft.com/en-us/edge/download?form=MA13FJ) / [Full DL](https://www.microsoft.com/en-us/edge/business/download?form=MA13FJ)
<img src="https://github.com/ShadowWhisperer/Remove-MS-Edge/blob/main/_Source/Screenshot_GUI.PNG"/>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,3 +1,5 @@
#!/usr/bin/env python
#
# Check if ran with admin permissions
# Get Admin permissions
@ -18,7 +20,7 @@ import ctypes #Check if ran as an admin / Window title
import getpass #Take Permissions
import os #System os paths
import sys #Check if ran as an admin
import subprocess #Run setup.exe file
import subprocess #Run subprocesses
import time #Wait 2 Seconds
import winreg #Modify Windows Registry (Remove Edge Appx Packages)
from tkinter import * #GUI
@ -26,7 +28,7 @@ from tkinter.scrolledtext import ScrolledText
#GUI Settings
root = Tk()
root.title("Bye Bye Edge - 5/23/2023 - https://github.com/ShadowWhisperer") #Windows Title
root.title("Bye Bye Edge - 6/1/2023 - https://github.com/ShadowWhisperer") #Windows Title
root.geometry("800x500") #Windows Size (width x height)
root.iconbitmap(sys._MEIPASS + "/icon.ico") #Icon
@ -41,6 +43,12 @@ if not is_admin():
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
os._exit(0)
#Hide CMD/Powershell
def hide_console():
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
startupinfo.dwFlags |= subprocess.CREATE_NO_WINDOW
return startupinfo
def remove_edge():
output_terminal.delete("1.0", END) #Clear Terminal
@ -131,7 +139,7 @@ def remove_edge():
root.update()
#Startup - Active Setup
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}', '/f'], startupinfo=hide_console())
#Startup Files *Wildcard
try:
@ -144,31 +152,31 @@ def remove_edge():
except Exception:
pass
#Tasks - Name
result = subprocess.run(['schtasks', '/query', '/fo', 'csv'], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW)
# Tasks - Name
result = subprocess.run(['schtasks', '/query', '/fo', 'csv'], capture_output=True, text=True, startupinfo=hide_console())
tasks = result.stdout.strip().split('\n')[1:]
microsoft_edge_tasks = [task.split(',')[0].strip('"') for task in tasks if 'MicrosoftEdge' in task]
with open(os.devnull, 'w') as devnull:
for task in microsoft_edge_tasks:
output_terminal.insert(END, f" Task: {task}\n")
root.update()
subprocess.run(['schtasks', '/delete', '/tn', task, '/f'], check=False, stdout=devnull, stderr=devnull)
subprocess.run(['schtasks', '/delete', '/tn', task, '/f'], check=False, stdout=devnull, stderr=devnull, startupinfo=hide_console())
#Tasks - Files
# Tasks - Files
for tsks, dirs, files in os.walk(r"C:\Windows\System32\Tasks"):
[os.remove(os.path.join(tasks, file)) for file in files if file.startswith("MicrosoftEdge")]
[os.remove(os.path.join(tasks, file)) for file in files if file.startswith("MicrosoftEdge")]
#Edge Update Services
service_names = ["edgeupdate", "edgeupdatem"]
for name in service_names:
if subprocess.run(['sc', 'delete', name], capture_output=True, text=True).returncode == 0:
if subprocess.run(['sc', 'delete', name], capture_output=True, text=True, startupinfo=hide_console()).returncode == 0:
output_terminal.insert(END, f" Service: {name}\n")
root.update()
subprocess.run(['reg', 'delete', r'HKLM\SYSTEM\CurrentControlSet\Services\edgeupdate', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SYSTEM\CurrentControlSet\Services\edgeupdatem', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SYSTEM\CurrentControlSet\Services\edgeupdate', '/f'], startupinfo=hide_console())
subprocess.run(['reg', 'delete', r'HKLM\SYSTEM\CurrentControlSet\Services\edgeupdatem', '/f'], startupinfo=hide_console())
#Edge Update - Remaining
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate', '/f'], startupinfo=hide_console())
#Program Files (x86)\Microsoft\Edge\Edge.dat
os.remove(r"C:\Program Files (x86)\Microsoft\Edge\Edge.dat") if os.path.isfile(r"C:\Program Files (x86)\Microsoft\Edge\Edge.dat") else None
@ -199,7 +207,7 @@ def remove_edge():
#Remaining Edge Keys - HKLM\SOFTWARE\WOW6432Node\Microsoft\Edge
if not os.path.exists(r"C:\Program Files (x86)\Microsoft\Edge\Application\pwahelper.exe"):
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\WOW6432Node\Microsoft\Edge', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\WOW6432Node\Microsoft\Edge', '/f'], stdout=subprocess.DEVNULL, startupinfo=hide_console())
#Folders - C:\Windows\SystemApps\Microsoft.MicrosoftEdge*
for directory, dirs, files in os.walk(r"C:\Windows\SystemApps"):
@ -208,7 +216,7 @@ def remove_edge():
folder_path = os.path.join(directory, folder)
output_terminal.insert(END, f" Folder: {folder_path}\n")
root.update()
subprocess.run('takeown /f "{}" /r /d y && icacls "{}" /grant administrators:F /t && rd /s /q "{}"'.format(folder_path, folder_path, folder_path), shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run('takeown /f "{}" /r /d y && icacls "{}" /grant administrators:F /t && rd /s /q "{}"'.format(folder_path, folder_path, folder_path), startupinfo=hide_console(), shell=True)
output_terminal.insert(END, "\n\nFinished!\n", "green",)
#####################################################################################################################################
@ -217,12 +225,6 @@ def remove_edge():
def exit_program():
sys.exit()
#Don't show PowerShell window
def hide_console():
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = subprocess.SW_HIDE
return startupinfo
webview_var = BooleanVar()
webview_var.set(True)

View file

@ -8,56 +8,84 @@
# Check if EdgeWebView directory exists
# Run the uninstall file
#
# Remove Edge Appx packages
# Delete desktop icons
# Delete start menu icons
# Delete other files
# Remove Edge Appx packages
# Delete startup files
# Delete tasks
# Delete services
# Delete other files / folders
#
import ctypes # Check if ran as an admin / Window title
import getpass # Take Permissions
import os # System OS paths
import sys # Check if ran as an admin
import sys # Check if ran as an admin / silent flag
import subprocess # Run setup.exe file
import winreg # Modify Windows Registry (Remove Edge Appx Packages)
import time # Wait 2 seconds
# Set Script Title
ctypes.windll.kernel32.SetConsoleTitleW("Bye Bye Edge")
# Check if running as admin
def is_admin():
try:
return ctypes.windll.shell32.IsUserAnAdmin()
except:
return False
if not is_admin():
if not ctypes.windll.shell32.IsUserAnAdmin():
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
os._exit(0)
# Flags
# /s = silent (no printing)
# /e = edge only
silent_mode = False
edge_only_mode = False
if len(sys.argv) > 1:
if sys.argv[1] == '/s':
silent_mode = True
elif sys.argv[1] == '/e':
edge_only_mode = True
elif sys.argv[1] == '/?':
print("Usage:")
print(" /s Silent")
print(" /e Edge only")
print("\n")
sys.exit()
else:
ctypes.windll.kernel32.SetConsoleTitleW("Bye Bye Edge - 6/8/2023 - https://github.com/ShadowWhisperer")
#Hide CMD/Powershell
def hide_console():
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
startupinfo.dwFlags |= subprocess.CREATE_NO_WINDOW
return startupinfo
#Setup.exe location
src = os.path.join(sys._MEIPASS, "setup.exe")
################################################################################################################################################
#Edge
if os.path.exists(r"C:\Program Files (x86)\Microsoft\Edge\Application"):
print("Removing Microsoft Edge")
if not silent_mode:
print("Removing Microsoft Edge")
cmd = [src, "--uninstall", "--system-level", "--force-uninstall"]
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
time.sleep(2)
#EdgeWebView
if os.path.exists(r"C:\Program Files (x86)\Microsoft\EdgeWebView\Application"):
print("Removing WebView")
cmd = [src, "--uninstall", "--msedgewebview", "--system-level", "--force-uninstall"]
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
time.sleep(2)
if not edge_only_mode:
if os.path.exists(r"C:\Program Files (x86)\Microsoft\EdgeWebView\Application"):
if not silent_mode:
print("Removing WebView")
cmd = [src, "--uninstall", "--msedgewebview", "--system-level", "--force-uninstall"]
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
time.sleep(2)
################################################################################################################################################
#Remove Edge Appx Packages
user_sid = subprocess.check_output(["powershell", "(Get-LocalUser -Name $env:USERNAME).SID.Value"]).decode().strip()
output = subprocess.check_output(['powershell', '-NoProfile', '-Command', 'Get-AppxPackage -AllUsers | Where-Object {$_.PackageFullName -like "*microsoftedge*"} | Select-Object -ExpandProperty PackageFullName'])
user_sid = subprocess.check_output(["powershell", "(Get-LocalUser -Name $env:USERNAME).SID.Value"], startupinfo=hide_console()).decode().strip()
output = subprocess.check_output(['powershell', '-NoProfile', '-Command', 'Get-AppxPackage -AllUsers | Where-Object {$_.PackageFullName -like "*microsoftedge*"} | Select-Object -ExpandProperty PackageFullName'], startupinfo=hide_console())
edge_apps = output.decode().strip().split('\r\n')
if output:
for app in edge_apps:
@ -65,8 +93,8 @@ if output:
key_path_local = f"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Appx\\AppxAllUserStore\\EndOfLife\\S-1-5-18\\{app}"
winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, key_path_user)
winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, key_path_local)
subprocess.run(['powershell', '-Command', f'Remove-AppxPackage -Package {app} 2>$null'])
subprocess.run(['powershell', '-Command', f'Remove-AppxPackage -Package {app} -AllUsers 2>$null'])
subprocess.run(['powershell', '-Command', f'Remove-AppxPackage -Package {app} 2>$null'], startupinfo=hide_console())
subprocess.run(['powershell', '-Command', f'Remove-AppxPackage -Package {app} -AllUsers 2>$null'], startupinfo=hide_console())
else:
pass
@ -76,7 +104,7 @@ else:
subprocess.run('rmdir /q /s "C:\\ProgramData\\Microsoft\\EdgeUpdate"', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
#Startup - Active Setup
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}', '/f'], startupinfo=hide_console(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
#Desktop Icons
for dir_name in os.listdir(r"C:\Users"):
@ -89,12 +117,12 @@ if os.path.exists(r"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microso
os.remove(r"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk")
#Tasks - Name
result = subprocess.run(['schtasks', '/query', '/fo', 'csv'], capture_output=True, text=True, creationflags=subprocess.CREATE_NO_WINDOW)
result = subprocess.run(['schtasks', '/query', '/fo', 'csv'], capture_output=True, text=True, startupinfo=hide_console())
tasks = result.stdout.strip().split('\n')[1:]
microsoft_edge_tasks = [task.split(',')[0].strip('"') for task in tasks if 'MicrosoftEdge' in task]
with open(os.devnull, 'w') as devnull:
for task in microsoft_edge_tasks:
subprocess.run(['schtasks', '/delete', '/tn', task, '/f'], check=False, stdout=devnull, stderr=devnull)
subprocess.run(['schtasks', '/delete', '/tn', task, '/f'], check=False, stdout=devnull, stderr=devnull, startupinfo=hide_console())
#Tasks - Files
for tsks, dirs, files in os.walk(r"C:\Windows\System32\Tasks"):
@ -103,23 +131,24 @@ for tsks, dirs, files in os.walk(r"C:\Windows\System32\Tasks"):
#Edge Update Services
service_names = ["edgeupdate", "edgeupdatem"]
for name in service_names:
subprocess.run(['sc', 'delete', name], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SYSTEM\CurrentControlSet\Services\edgeupdate', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SYSTEM\CurrentControlSet\Services\edgeupdatem', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
if subprocess.run(['sc', 'delete', name], capture_output=True, text=True, startupinfo=hide_console()).returncode == 0:
subprocess.run(['reg', 'delete', r'HKLM\SYSTEM\CurrentControlSet\Services\edgeupdate', '/f'], startupinfo=hide_console(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SYSTEM\CurrentControlSet\Services\edgeupdatem', '/f'], startupinfo=hide_console(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
#Edge Update - Remaining
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
# Edge Update - Remaining
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate', '/f'], startupinfo=hide_console(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
#Remaining Edge Keys - HKLM\SOFTWARE\WOW6432Node\Microsoft\Edge
# Remaining Edge Keys - HKLM\SOFTWARE\WOW6432Node\Microsoft\Edge
if not os.path.exists(r"C:\Program Files (x86)\Microsoft\Edge\Application\pwahelper.exe"):
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\WOW6432Node\Microsoft\Edge', '/f'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.run(['reg', 'delete', r'HKLM\SOFTWARE\WOW6432Node\Microsoft\Edge', '/f'], startupinfo=hide_console(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
#Folders - C:\Windows\SystemApps\Microsoft.MicrosoftEdge*
for directory, dirs, files in os.walk(r"C:\Windows\SystemApps"):
for folder in dirs:
if folder.startswith("Microsoft.MicrosoftEdge"):
folder_path = os.path.join(directory, folder)
subprocess.run('takeown /f "{}" /r /d y && icacls "{}" /grant administrators:F /t && rd /s /q "{}"'.format(folder_path, folder_path, folder_path), shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
with open(os.devnull, "w") as devnull:
subprocess.run('takeown /f "{}" /r /d y && icacls "{}" /grant administrators:F /t && rd /s /q "{}"'.format(folder_path, folder_path, folder_path), startupinfo=hide_console(), shell=True, stdout=devnull, stderr=devnull)
#System32 Files
user_name = getpass.getuser()