none
Uninstalling exe silently RRS feed

  • Question

  • I have taken a stab at writing script that uninstalls Mozilla Firefox. Ideally I would like it to also uninstall silently. The problem I'm facing is that it does not install ...

    $Mozilla = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall  |
        Get-ItemProperty |
            Where-Object {$_.DisplayName -like "Mozilla Firefox*" } |
                Select-Object -Property DisplayName, UninstallString
    
    ForEach ($ver in $Mozilla) {
    
        If ($ver.UninstallString) {
    
            $uninst = $ver.UninstallString
            $uninst = $uninst.Replace('{',' ').Replace('}',' ')
            Invoke-Expression $uninst 
        }
    
    }

    This is the output after I run the script.

    PS C:\Users\afk-dheinz> $Mozilla = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall  |
        Get-ItemProperty |
            Where-Object {$_.DisplayName -like "Mozilla Firefox*" } |
                Select-Object -Property DisplayName, UninstallString
    
    ForEach ($ver in $Mozilla) {
    
        If ($ver.UninstallString) {
    
            $uninst = $ver.UninstallString
            $uninst = $uninst.Replace('{',' ').Replace('}',' ')
            Invoke-Expression $uninst
        }
    
    }
    
    C:\Program Files\Mozilla Firefox\uninstall\helper.exe


    DHeinz

    • Moved by Bill_Stewart Wednesday, December 12, 2018 8:06 PM This is not third-party support forum
    Thursday, August 23, 2018 5:55 PM

All replies

  • Post Firefox issues in the Firefox forum.

    To uninstall most programs just execute the uninstall string as is.


    \_(ツ)_/

    Thursday, August 23, 2018 6:02 PM