Page 1 sur 1

Désinstallation silencieuse Zippers

Posté : jeu. 31 janv. 2013 10:21
par aymeric81401
Salut les amis, je vous propose ce script "made in moi" :D

Je m'explique, au boulot, on a une multitude de zipper, et je voulais homogénéiser le parc.
Du coup, il me fallait désinstaller tous les zippers pour ensuite installer 7Zip9.20 (gratuit et puissant)

Comment ça fonctionne ?
Simplement, je test la non-présence des répertoires, si le dossier existe je désinstalle silencieusement l'application, sinon je saute la partie du script correspondant pour passer au prochain zipper.
L'installation de 7Zip9.20 se fera via un déploiement avec mon serveur OCS Inventory

Code : Tout sélectionner

@echo off

SET Rep7Z=c:\progra~1\7-Zip
SET RepWinRar=c:\progra~1\WinRAR
SET RepWinZip=c:\progra~1\WinZip

Echo =
Echo =======================================
Echo =  MAINTENANCE DES POSTES DE TRAVAIL  =
Echo DESINSTALLATION 7-ZIP, WinRAR et WinZIP
Echo =======================================
Echo =

IF NOT EXIST %Rep7Z% goto 7ZNUL
Echo -
Echo ---------------------------------------
Echo DESINSTALLATION DE 7-ZIP
Echo ---------------------------------------
Echo -
%Rep7Z%\uninstall.exe /S
ping 127.0.0.1 -n 21 > NUL

:7ZNUL

IF NOT EXIST %RepWinRar% goto WRNUL
Echo -
Echo ---------------------------------------
Echo DESINSTALLATION DE WINRAR
Echo ---------------------------------------
Echo -
%RepWinRar%\uninstall.exe /S
taskkill /F /IM "WinRAR.exe"
ping 127.0.0.1 -n 21 > NUL

:WRNUL

IF NOT EXIST %RepWinZip% goto WZNUL
Echo -
Echo ---------------------------------------
Echo DESINSTALLATION DE WINZIP
Echo ---------------------------------------
Echo -
taskkill /F /IM wzqkpick.exe
wmic product where "name like '%%winzip%%'" call Uninstall
If Exist %RepWinZip%\winzip32.exe goto 64
If Exist %RepWinZip%\winzip32.exe "%RepWinZip%\Winzip32.exe" /Uninstallx
taskkill /F /IM iexplore.exe
:64
%RepWinZip%\Winzip32.exe /Uninstallx
taskkill /F /IM iexplore.exe
ping 127.0.0.1 -n 21 > NUL

:WZNUL

@echo on
Exit

Re: Désinstallation silencieuse Zippers

Posté : jeu. 31 janv. 2013 11:01
par Nash
nice aymeric ;)

Re: Désinstallation silencieuse Zippers

Posté : jeu. 31 janv. 2013 11:50
par Chewbacca
top bravo^^

Re: Désinstallation silencieuse Zippers

Posté : jeu. 31 janv. 2013 12:59
par CometeFilou2
Merci Aymeric, même si j'y comprend rien :D

Re: Désinstallation silencieuse Zippers

Posté : jeu. 31 janv. 2013 18:31
par Prof
Bien joué et merci pour le partage :)

Re: Désinstallation silencieuse Zippers

Posté : jeu. 31 janv. 2013 18:54
par Sliden
Vraiment bien ce fichier, merci pour le partage.

Si les ping servent uniquement a créer une attente, il est possible d'utiliser :

Code : Tout sélectionner

timeout /t 21 >nul
Le chiffre = les secondes d'attente.

Re: Désinstallation silencieuse Zippers

Posté : jeu. 31 janv. 2013 19:05
par aymeric81401
@Sliden : en effet c'est pour faire une tempo
Merci je connaissais pas ;)