Cisco VPN Command Line

I work remote, and use the Cisco VPN client to connect to the network.  There’s a timeout set on our concentrator that gives me the boot every day.  It’s a minor annoyance to be sure, but still.  It’s no fun being deep in thought on a server only to be unceremoniously kicked from the network.

So I’ve been fiddling with the command line interface of the client, to see if I can cobble together a script I can schedule to log me out and back in on my time frame rather than that of the concentrator.  Here’s what I’ve come up with so far.

1
2
3
"%programfiles(x86)%\Cisco Systems\VPN Client\vpnclient.exe" disconnect

@echo y | "%programfiles(x86)%\Cisco Systems\VPN Client\vpnclient.exe" connect %1 user %2 pwd %3 nocertpwd stdin

The first line disconnects the current connection (if already disconnected the script continues gracefully).  The second line needs 3 arguments fed to it in this order: profile, username and password.  the @echo y | exists because the concentrator I connect to has a disclaimer splash that requires a Y response to bypass in order to fully establish the connection.

Thus far my only problem is I’ve not found a way to suppress the client GUI window that appears when the disconnect occurs.

Post a comment

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">