Cisco AnyConnect 3.1 silent install

This will:
  • use native windows tools to detect AnyConnect persistence
  • skip AnyConnect installation if other version is intalled
  • uninstall AnyConnect wherever it is installed including custom directory or different drive
  • uninstall it on 32-bit or 64-bit windows

silent-uninstal.cmd
@echo off
if not "%ProgramFiles(x86)%"=="" set x=Wow6432Node\
setlocal EnableDelayedExpansion
reg query "HKLM\SOFTWARE\%x%Microsoft\Windows\CurrentVersion\Uninstall" /s | find "Cisco AnyConnect Secure Mobility Client"
if not !errorlevel!==0 (
for /f "tokens=*" %%a in ('dir /b "%~dp0anyconnect-win*.msi"') do (
echo Cisco AnyConnect Secure Mobility Client
%systemroot%\system32\msiexec.exe /i "%~dp0%%a" /qb
)
) else echo Cisco AnyConnect Secure Mobility Client already exists!
endlocal
This is tested on:
anyconnect-win-3.1.05187-pre-deploy-k9.msi
b260a31b6970073d6157aca648ac5d14
875bbbdd86a65f5c5dab3e3d173fefb00b2f2e1f
ftp://ftp.a-f.ch/pub/Software/Cisco/AnyConnect%20VPN%20Client/Version%203.1.05187/

No comments: