lundi 1 mars 2021

CMD always uninstall firefox

Manual in cmd

c:\SolT>"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -v|more |Findstr Mo>file_8.tmp

c:\SolT>type file_8.tmp

Mozilla Firefox 35.0

c:\SolT>set /P prueba= < file_8.tmp

c:\SolT>Techo %prueba%

Mozilla Firefox 35.0

c:\SolT>If "Mozilla Firefox 35.0" EQU "%prueba%" echo es igual

es igual

in my bat

echo off

IF EXIST "C:\Program Files\Mozilla Firefox\firefox.exe" (

taskkill /IM "Firefox.exe" /F

"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" /s

rmdir /s /q     "%APPDATA%\Mozilla\Firefox\Profiles\"

Del /f      "%Appdata%\Mozilla\Firefox\profiles.ini"

wget.exe --continue --output-document=perfil.zip https://download -q --show-progress

wget.exe --continue --output-document=Firefox35.exe https//download -q --show-progress

Firefox35.exe /s

powershell Expand-Archive -Path perfil.zip -DestinationPath "%APPDATA%\Mozilla\Firefox\ -Force

) ELSE (

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -v|more |Findstr Mo>file_8.tmp

set /P prueba= < file_8.tmp

    If "Mozilla Firefox 35.0" EQU "%prueba%" (

        taskkill /IM "Firefox.exe" /F

        rmdir /s /q     "%APPDATA%\Mozilla\Firefox\Profiles\"

        Del /f      "%Appdata%\Mozilla\Firefox\profiles.ini"

        wget.exe --continue --output-document=perfil.zip https://download -q --show-progress

        powershell Expand-Archive -Path perfil.zip -DestinationPath "%APPDATA%\Mozilla\Firefox\ -Force

) else (

        taskkill /IM "Firefox.exe" /F

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

        rmdir /s /q     "%APPDATA%\Mozilla\Firefox\Profiles\"

        Del /f      "%Appdata%\Mozilla\Firefox\profiles.ini"

        wget.exe --continue --output-document=perfil.zip https://download -q --show-progress
        wget.exe --continue --output-document=Firefox35.exe https://download -q --show-progress
        Firefox35.exe /s
        powershell Expand-Archive -Path perfil.zip -DestinationPath "%APPDATA%\Mozilla\Firefox\ -Force

)

)

when I did tests the first time it worked correctly, at this moment in more than 2 computers it always works as if %prueba% did not match the version

Aucun commentaire:

Enregistrer un commentaire