Cisco on Windows
The current install path for Cisco Secure Client is:
C:\Program Files (x86)\Cisco\Cisco Secure Client\vpncli.exeThere's no direct Windows equivalent of oathtool, so TOTP codes come from totp-go instead: a small standalone CLI, no Python required.
Prerequisites
totp-go on PATH. The installer below fetches it if it's missing. To install it by hand:
irm https://sh.mawenqian.com/totp-go-install.ps1 | iexQuick install
irm https://sh.mawenqian.com/cisco-win-install.ps1 | iexWhat it does:
- Drops
cisco-vpn.batand aconfig.battemplate into%USERPROFILE%\.local\opt\cisco-vpn. Override with-InstallDir .... - Installs
totp-goif it isn't already onPATH. - Asks whether to create Connect VPN / Disconnect VPN shortcuts on your Desktop. Say yes and you never have to touch a terminal again.
Re-running the installer later refreshes cisco-vpn.bat without touching your config.bat.
Shortcut icons
connect.ico and disconnect.ico from the repo are used by default, one per shortcut.
To use your own, pass -ConnectIconUrl <url> / -DisconnectIconUrl <url> pointing at a .ico file. A shortcut's icon has to be a local .ico / .exe / .dll file (Windows has no notion of a remote icon URL), so a supplied URL is downloaded once into the install folder and pointed at locally.
Manual install
- Copy
Cisco/win/cisco-vpn.batandCisco/win/config.batinto the same folder. - Install
totp-go:irm https://sh.mawenqian.com/totp-go-install.ps1 | iex - Edit
config.batwith your realVPN_HOST,VPN_USER,VPN_PASSWORDandVPN_SECRET, the same variable names as the unix side'sconfig.sh. - Optional: put a shortcut to
cisco-vpn.baton your desktop so you can just double-click to connect.
Usage
Double-click cisco-vpn.bat (or run it from a terminal). It will:
- Print the current VPN state.
- Force-disconnect any existing session.
- Load
config.bat, generate a fresh TOTP code withtotp-go "%VPN_SECRET%", and write a scripted input file to%TEMP%\cisco_input.txtfrom within the batch script (no helper process involved). - Pipe that file into
vpncli.exe -s(scripted mode) to complete the login, then delete the temp file.
One-click disconnect
The quick install already creates this shortcut. To make one yourself, use this target:
C:\Windows\System32\cmd.exe /c "C:\Program Files (x86)\Cisco\Cisco Secure Client\vpncli.exe" disconnect & timeout /nobreak /t 3To change either shortcut's icon later: right-click it → Properties → Change Icon.