Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the Shrew client installed in order to connect to a cisco VPN.

(side note: anyconnect royally blows and I spent several hours trying to get it to work; I had shrew running within 2 minutes of installing it.)

Anyway, I can connect just fine and it works.

What I need to do is schedule the connection. For example, once a day I want a process to start shrew, auto connect to the vpn then run a SQL script. Once the script is finished I want shrew to disconnect from the VPN.

So far I have the following:

"C:\Program Files\ShrewSoft\VPN Client\ipsecc.exe" -r ClientSite -u MyUser -p MyPassword -a

When this runs, Shrew connects and starts the VPN interface. However, that line doesn't return until someone clicks the "disconnect" button.


share|improve this question
up vote 1 down vote accepted


ShrewSoft VPN doesn't have any command line parameters to disconnect. The only simple alternative is to send a taskkill to the process to close, e.g;

taskkill.exe /IM ipsecc.exe

Of course, this will affect all ipsecc processes should you have multiple VPNs active.

Non Blocking Start

You may want to use something like the "start" command to run the ipsecc command without blocking the batch process.

C:\Windows\system32>start /?
Starts a separate window to run a specified program or command.
share|improve this answer

I've open sourced some code which manages shrew connections and re-connections. UI is well isolated from the core so it would be easily modifiable to do whatever you need.

Check it out at if you're interested.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.