Search code examples
powershellwmiuninstallationpowershell-4.0

Uninstall a exe software using powershell


I am following this thread to uninstall mozilla firefox from my Windows 10 systems.

I have installed mozilla firefox originally with an exe installer and I don't get a mozilla entry executing gwmi -Class Win32_Product.

Is there any way I can trigger the uninstaller for that software on my windows system?

Note: I wont be able to use msi installer for this purpose.


Solution

  • If you run

    Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ | ? { $_ -match "Firefox" }
    

    It shows the UninstallString as:

    C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe

    You should be able to run this to remove Firefox. Use the /s switch to run a silent uninstall.

    Something along the lines of:

    '"C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe /s"' | cmd