Skip to content

Microsoft Edge - Remove

config/tweaks.json
587  "WPFTweaksRemoveEdge": {
588    "Content": "Microsoft Edge - Remove",
589    "Description": "Uninstalls Microsoft Edge by creating dummy MicrosoftEdge.exe file in the legacy Edge folder. This tricks Windows into unlocking the official Edge uninstaller allowing for a system-level removal.",
590    "category": "z__Advanced Tweaks - CAUTION",
591    "panel": "1",
592    "InvokeScript": [
593      "
594      $Path = Resolve-Path -Path \"$Env:ProgramFiles (x86)\\Microsoft\\Edge\\Application\\*\\Installer\\setup.exe\" | Select-Object -Last 1
595
596      if (Test-Path $Path) {
597          New-Item -Path \"$Env:SystemRoot\\SystemApps\\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\\MicrosoftEdge.exe\" -Force
598          Start-Process -FilePath $Path -ArgumentList \"--uninstall --system-level --force-uninstall --delete-profile\" -Wait
599          Write-Host \"Microsoft Edge was removed\"
600      } else {
601          Write-Host \"Microsoft Edge is not installed\"
602      }
603      "
604    ],
605    "UndoScript": [
606      "
607      Write-Host \"Installing Microsoft Edge...\"
608      winget install Microsoft.Edge --source winget
609      "
610    ],