Edge uninstallation fails through command line but works through GUI (Exit code 532) Windows 11 24H2

André de Oliveira 20 Reputation points
2024-12-24T02:38:26.61+00:00

I'm putting together a Windows setup script, which involves configuring settings, installing things I want and uninstalling things I don't. Among the things I want to uninstall are the Microsoft Edge browser, but while I'm able to do so manually, I run into trouble trying through the command line, and by extension through my script.

Windows 11 Pro Edition Version 24H2, testing in VMs. Region is set to Germany. Uninstalling Edge through the Settings GUI works as expected, I click through a confirmation prompt or two and it gets ripped out. But when I run the uninstall string through the command line, it just fails silently after a few seconds, the only indication anything is happening being the cursor briefly changing to the "processing in background" variety. I'm just trying the standard &"C:\Program Files (x86)\Microsoft\Edge\Application\*\Installer\setup.exe" --uninstall --system-level --force-uninstall in PowerShell, but I've also tried filling in the wildcard with the full version number, manually navigating to the directory and running .\setup.exe directly, finagling with the flags and doing all the same through Command Prompt. With elevation, of course (though I did a few runs without to see if anything would happen). With some poking I've found setup.exe is terminating with exit code 532 (also the output if I try uninstalling through WinGet), but I've unfortunately not been able to find anything on that status online.

Interesting to note is this behaviour seems to be the same as when trying to uninstall through the GUI on older builds of 24H2. I recall on some of my earlier testing hitting uninstall in Settings would similarly fail silently after the UAC prompt, an error I and others reported, but it seemed to be corrected in an update.

Does anyone know what this exit code means? Or has experienced something similar before? Any idea how/if it can be fixed, or if it's just a bug of some kind? Thanks.

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,399 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ShiJieLi-MSFT 11,021 Reputation points Microsoft Vendor
    2024-12-24T08:32:45.4366667+00:00

    Hi @André de Oliveira,

    I can successfully reproduce this issue, and I think the uninstallation via command line is just not allowed for now (due to patches or something), even if you can now uninstall it from GUI.

    I've got 2 copies of Edge Installer Log, 1 for successful uninstallation and 1 for failure. If you compare them, you would find that

    1. Uninstallation is not allowed when you use the UninstallString (that --force-uninstall one) in CMD. Here're the logs:
         [8096:2736:1224/154931.567:1785000:VERBOSE1:edge_install_util.cc(216)] Parent process: C:\Windows\System32\cmd.exe
         [8096:2736:1224/154931.567:1785000:VERBOSE1:edge_install_util.cc(274)] Stable is not uninstallable for process.
      
    2. Uninstallation is allowed when you use the GUI. The GUI simply calls a Windows API to help on uninstallation, and that Windows API apparently has the permission to uninstall Edge:
         [8152:14332:1224/153617.820:991265:VERBOSE1:edge_install_util.cc(216)] Parent process: C:\Windows\System32\sihost.exe
         [8152:14332:1224/153617.820:991265:VERBOSE1:edge_install_util.cc(256)] Uninstall allowed: Windows caller
      

    So, it is not possible to uninstall Edge from command line so far, but you can still check with the Dev Team for more information. You can send feedback in Microsoft Edge at ··· menu --> Help and feedback --> Send feedback, or you can send feedback at Feedback Hub on Windows.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,

    Shijie Li

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.