Skip to content

Instantly share code, notes, and snippets.

@PureOcean
Last active March 16, 2022 16:08
Show Gist options
  • Save PureOcean/59df02cfcaeef067d6b11e9cd611d7c2 to your computer and use it in GitHub Desktop.
Save PureOcean/59df02cfcaeef067d6b11e9cd611d7c2 to your computer and use it in GitHub Desktop.
Removes secretly installed the EdgeUpdate by MS Edge Browser and prevents reinstallation
:: The BAT script completely removes the EdgeUpdate from disk and Registry, which it's always being forcefully installed by
:: MS Edge Browser and prevents it from reinstalling.
:: Microsoft Edge (based Chromium) Browser installs the "Edge Improved Recovery" component in background.
:: The "Edge Improved Recovery" downloads msedgerecovery.exe to %TEMP% folder. After execute it:
:: %ProgramFiles(x86)%\Microsoft\Temp\***\MicrosoftEdgeUpdate.exe" /install "runtime=true&needsadmin=false" /installsource chromerecovery /silent).
:: Unfortunately impossible to turn off only "Edge Improved Recovery" for now.
@echo off
echo.
taskkill /im MicrosoftEdgeUpdate.exe /f 1>nul 2>nul
for /F "delims=" %%c in ('dir /s /b "%LocalAppData%\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe"') do "%%c" /uninstall 1>nul 2>nul
for /F "delims=" %%c in ('dir /s /b "%ProgramFiles(x86)%\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe"') do "%%c" /uninstall 1>nul 2>nul
for /F "delims=" %%c in ('dir /s /b "%ProgramW6432%\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe"') do "%%c" /uninstall 1>nul 2>nul
SC stop "edgeupdate" 1>nul 2>nul
SC delete "edgeupdate" 1>nul 2>nul
SC stop "edgeupdatem" 1>nul 2>nul
SC delete "edgeupdatem" 1>nul 2>nul
rd /s /q "%LocalAppData%\Microsoft\EdgeUpdate" 1>nul 2>nul
rd /s /q "%ProgramData%\Microsoft\EdgeUpdate" 1>nul 2>nul
rd /s /q "%ProgramFiles(x86)%\Microsoft\EdgeUpdate" 1>nul 2>nul
rd /s /q "%ProgramFiles(x86)%\Microsoft\Temp" 1>nul 2>nul
for /F "tokens=* skip=1" %%n in ('wmic useraccount where "name='%username%'" get sid ^| findstr "."') do (set SID=%%n)
schtasks /F /delete /tn "MicrosoftEdgeUpdateTaskMachineCore" 1>nul 2>nul
schtasks /F /delete /tn "MicrosoftEdgeUpdateTaskMachineUA" 1>nul 2>nul
schtasks /F /delete /tn "MicrosoftEdgeUpdateTaskUser%SID:~0,-3%Core" 1>nul 2>nul
schtasks /F /delete /tn "MicrosoftEdgeUpdateTaskUser%SID:~0,-3%UA" 1>nul 2>nul
REG.exe DELETE "HKCR\AppID\MicrosoftEdgeUpdate.exe" /f 1>nul 2>nul
REG.exe DELETE "HKCR\WOW6432Node\AppID\MicrosoftEdgeUpdate.exe" /f 1>nul 2>nul
REG.exe DELETE "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "Microsoft Edge Update" /f 1>nul 2>nul
REG.exe DELETE "HKCU\SOFTWARE\Microsoft\EdgeUpdate" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\Microsoft\EdgeUpdate" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MicrosoftEdgeUpdate.exe" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MicrosoftEdgeUpdate.exe" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\edgeupdate" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\edgeupdatem" /f 1>nul 2>nul
for %%G in (
MicrosoftEdgeUpdate.exe
MicrosoftEdgeUpdate.CoreClass
MicrosoftEdgeUpdate.CoreClass.1
MicrosoftEdgeUpdate.CoreMachineClass
MicrosoftEdgeUpdate.CoreMachineClass.1
MicrosoftEdgeUpdate.CredentialDialogMachine
MicrosoftEdgeUpdate.CredentialDialogMachine.1.0
MicrosoftEdgeUpdate.CredentialDialogUser
MicrosoftEdgeUpdate.CredentialDialogUser.1.0
MicrosoftEdgeUpdate.OnDemandCOMClassMachine
MicrosoftEdgeUpdate.OnDemandCOMClassMachine.1.0
MicrosoftEdgeUpdate.OnDemandCOMClassMachineFallback
MicrosoftEdgeUpdate.OnDemandCOMClassMachineFallback.1.0
MicrosoftEdgeUpdate.OnDemandCOMClassSvc
MicrosoftEdgeUpdate.OnDemandCOMClassSvc.1.0
MicrosoftEdgeUpdate.OnDemandCOMClassUser
MicrosoftEdgeUpdate.OnDemandCOMClassUser.1.0
MicrosoftEdgeUpdate.PolicyStatusMachine
MicrosoftEdgeUpdate.PolicyStatusMachine.1.0
MicrosoftEdgeUpdate.PolicyStatusMachineFallback
MicrosoftEdgeUpdate.PolicyStatusMachineFallback.1.0
MicrosoftEdgeUpdate.PolicyStatusSvc
MicrosoftEdgeUpdate.PolicyStatusSvc.1.0
MicrosoftEdgeUpdate.PolicyStatusUser
MicrosoftEdgeUpdate.PolicyStatusUser.1.0
MicrosoftEdgeUpdate.ProcessLauncher
MicrosoftEdgeUpdate.ProcessLauncher.1.0
MicrosoftEdgeUpdate.Update3COMClassService
MicrosoftEdgeUpdate.Update3COMClassService.1.0
MicrosoftEdgeUpdate.Update3COMClassUser
MicrosoftEdgeUpdate.Update3COMClassUser.1.0
MicrosoftEdgeUpdate.Update3WebMachine
MicrosoftEdgeUpdate.Update3WebMachine.1.0
MicrosoftEdgeUpdate.Update3WebMachineFallback
MicrosoftEdgeUpdate.Update3WebMachineFallback.1.0
MicrosoftEdgeUpdate.Update3WebSvc
MicrosoftEdgeUpdate.Update3WebSvc.1.0
MicrosoftEdgeUpdate.Update3WebUser
MicrosoftEdgeUpdate.Update3WebUser.1.0
) do (
REG.exe DELETE "HKCU\SOFTWARE\Classes\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKCR\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\Classes\%%G" /f 1>nul 2>nul
)
for %%G in (
{01029388-0B8F-484C-BC0F-AC1E79630A9A}
{02FCF358-FC8A-4CE4-AD4F-E29CD2D17A58}
{08D832B9-D2FD-481F-98CF-904D00DF63CC}
{254269A0-75F7-44E4-92E6-047DBA7D1A83}
{2E1DD7EF-C12D-4F8E-8AD8-CF8CC265BAD0}
{2F49C178-F8BF-43FD-B8F2-1A5B9D6BAD8E}
{492E1C30-A1A2-4695-87C8-7A8CAD6F936F}
{59E5039B-6524-481C-A78C-E680D7BF086C}
{5EA43877-C6D8-4885-B77A-C0BB27E94372}
{5F6A18BB-6231-424B-8242-19E5BB94F8ED}
{77857D02-7A25-4B67-9266-3E122A8F39E4}
{81093D63-7825-417B-BFC8-ADC63FA4E53D}
{82AFD803-5E4E-4D27-9E95-2A3C563D8D55}
{8E128ECA-8AE9-4454-96E1-E67B8C5FF6D9}
{8EA8DF82-090A-4EFE-9D46-CC8B490270D3}
{8F09CD6C-5964-4573-82E3-EBFF7702865B}
{9844CEE9-982E-46C3-8225-FD127CE94B1C}
{9E8F1B36-249F-4FC3-9994-974AFAA07B26}
{9F3F5F5D-721A-4B19-9B5D-69F664C1A591}
{A2F5CB38-265F-4A02-9D1E-F25B664968AB}
{A533BCB1-6D33-41FC-8C3B-63223FCCE9D2}
{A6B716CB-028B-404D-B72C-50E153DD68DA}
{ADCADE6C-AEB8-450F-AE7C-BFF46E8082F9}
{B532B342-0E34-448B-9EDF-1D55C04041F8}
{B5977F34-9264-4AC3-9B31-1224827FF6E8}
{BA219326-CF19-44D0-8495-3327B1868DFA}
{C1339708-2882-4647-A280-BEC7AF3217B4}
{CECDDD22-2E72-4832-9606-A9B0E5E344B2}
{CF812DE5-76F9-4E07-9039-C17D1ADBDE24}
{D1E8B1A6-32CE-443C-8E2E-EBA90C481353}
{DAFA040D-F6C0-4A7E-904A-7516DDBF03D8}
{E0DCAE7C-1D0A-4AD0-B92C-2FFDAEE1562B}
{E421557C-0628-43FB-BF2B-7C9F8A4D067C}
{EA92A799-267E-4DF5-A6ED-6A7E0684BB8A}
{EF09F947-7021-4290-94D1-E03B3C070706}
{FEA917C3-2EF1-4612-88D9-59ADCDAF3E5B}
{FF419FF9-90BE-4D9F-B410-A789F90E5A7C}
) DO (
REG.exe DELETE "HKCR\CLSID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKCR\WOW6432Node\AppID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKCR\WOW6432Node\CLSID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKCR\AppID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKCU\SOFTWARE\Classes\CLSID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKCU\SOFTWARE\Classes\WOW6432Node\CLSID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\Classes\AppID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\Classes\CLSID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\Classes\WOW6432Node\AppID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\Classes\WOW6432Node\CLSID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\WOW6432Node\Classes\AppID\%%G" /f 1>nul 2>nul
REG.exe DELETE "HKLM\SOFTWARE\WOW6432Node\Classes\CLSID\%%G" /f 1>nul 2>nul
)
MD "%LocalAppData%\Microsoft\EdgeUpdate" 1>nul 2>nul
icacls.exe "%LocalAppData%\Microsoft\EdgeUpdate" /deny "%username%":W 1>nul 2>nul
echo.
MD "%ProgramData%\Microsoft\EdgeUpdate" 1>nul 2>nul
icacls.exe "%ProgramData%\Microsoft\EdgeUpdate" /deny "%username%":W 1>nul 2>nul
pause
echo.
exit /b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment