Last active
July 16, 2023 06:48
-
-
Save eebssk1/8154f9253a58ebf056cca87a751843cd to your computer and use it in GitHub Desktop.
Fully uninstall Microsoft edge with one simple script (iso preinstalled only)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FOR /F %%I IN ('dir /B "C:\Program Files (x86)\Microsoft\Edge\Application" ^| findstr [0-9]') DO set a=%%I | |
echo find is %a% | |
set b="C:\Program Files (x86)\Microsoft\Edge\Application\%a%\Installer\setup.exe" | |
%b% --uninstall --force-uninstall --system-level --delete-profile | |
rmdir /s /q "C:\Program Files (x86)\Microsoft\Edge" | |
for /f "tokens=8 delims=\" %%T in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" ^| findstr "Microsoft-Windows-Internet-Browser-Package" ^| findstr "~~"') do (set "edge_legacy_package_version=%%T") | |
if defined edge_legacy_package_version ( | |
echo Removing %edge_legacy_package_version%... | |
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\%edge_legacy_package_version%" /v Visibility /t REG_DWORD /d 1 /f | |
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\%edge_legacy_package_version%\Owners" /va /f | |
dism /online /Remove-Package /PackageName:%edge_legacy_package_version% | |
powershell.exe -Command "Get-AppxPackage *edge* | Remove-AppxPackage" >nul | |
) | |
schtasks /Change /TN "\MicrosoftEdgeUpdateTaskMachineUA" /Disable | |
sc config "edgeupdate" start=disabled | |
sc config "edgeupdatem" start=disabled | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment