Guest User

Untitled

a guest
May 9th, 2023
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. @echo off
  2. @title Microsoft Edge Uninstaller [Windows 10 LTSC 2021/21H1 Edition]
  3. ver
  4.  
  5. echo+
  6. goto check_admin_permissions
  7. :check_admin_permissions
  8. echo Script must Run as Administrator! Detecting permissions...
  9. net session >nul 2>&1
  10. if %errorLevel% == 0 (
  11. echo Success!
  12. ) else (
  13. echo Failure. Please, Run script as Administrator!
  14. echo+
  15. echo Exiting...
  16. timeout /t 5 /nobreak >nul
  17. exit /b
  18. )
  19.  
  20. echo+
  21. echo Press any key to remove Microsoft Edge from Windows 10...
  22. pause >nul
  23.  
  24. echo+
  25. echo Microsoft Edge [Chromium] uninstalling...
  26.  
  27. cd /d "%ProgramFiles(x86)%\Microsoft"
  28. for /f "tokens=1 delims=\" %%i in ('dir /B /A:D "%ProgramFiles(x86)%\Microsoft\Edge\Application" ^| find "."') do (set "edge_chromium_package_version=%%i")
  29. if defined edge_chromium_package_version (
  30. echo Removing %edge_chromium_package_version%...
  31. EdgeWebView\Application\%edge_chromium_package_version%\Installer\setup.exe --uninstall --force-uninstall --msedgewebview --system-level --verbose-logging
  32. Edge\Application\%edge_chromium_package_version%\Installer\setup.exe --uninstall --force-uninstall --msedge --system-level --verbose-logging
  33. EdgeCore\%edge_chromium_package_version%\Installer\setup.exe --uninstall --force-uninstall --msedge --system-level --verbose-logging
  34. ) else (
  35. echo Microsoft Edge [Chromium] not found, skipping.
  36. )
  37. cd /d "%~dp0"
  38.  
  39. echo+
  40. echo Microsoft Edge [Legacy/UWP] uninstalling...
  41.  
  42. for /f "tokens=8 delims=\" %%i 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=%%i")
  43. if defined edge_legacy_package_version (
  44. echo Removing %edge_legacy_package_version%...
  45. reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\%edge_legacy_package_version%" /v Visibility /t REG_DWORD /d 1 /f
  46. reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\%edge_legacy_package_version%\Owners" /va /f
  47. dism /online /Remove-Package /PackageName:%edge_legacy_package_version%
  48. powershell.exe -Command "Get-AppxPackage *edge* | Remove-AppxPackage" >nul
  49. ) else (
  50. echo Microsoft Edge [Legacy/UWP] not found, skipping.
  51. )
  52.  
  53. echo+
  54. echo Done!
  55. echo Press any key to exit.
  56.  
  57. rem by @ishad0w
  58. pause >nul
  59. exit /b
  60.  
Add Comment
Please, Sign In to add comment