[vpn-help] Connect to VPN from Command line (Win7)

C.Hoffmann at ProSeS.de C.Hoffmann at ProSeS.de
Thu Jan 6 10:53:42 CST 2011


Sure. Use

"C:\Program Files\ShrewSoft VPN Client\ipsecc.exe" -r ConnName -u User -p Password -a

to connect. I can't remember if ipsecc waits until disconnected or returns immediately - in the later case you need to start it with start /w, as shown below. The complete script should look like this:

@echo off
:loop
start /w "Shrew"
"C:\Program Files\ShrewSoft VPN Client\ipsecc.exe" -r ConnName -u User -p Password -a
ping -n 6 127.0.0.1 >nul
goto loop

(The ping is used to implement a 5 second grace period for stopping the batch).

Clemens Hoffmann

________________________________
Von: vpn-help-bounces at lists.shrew.net [vpn-help-bounces at lists.shrew.net] im Auftrag von Zsolt Fejer [Zsolt.Fejer at orb-data.com]
Gesendet: Donnerstag, 6. Januar 2011 13:01
An: vpn-help at lists.shrew.net
Betreff: [vpn-help] Connect to VPN from Command line (Win7)

Hi,

Is there any way to connect to a VPN via Command Line? Either cmd script or Powershell.

I have a pretty unreliable network and it’d be good to monitor the connection and reconnect whenever it drops the line.

regards
Zsolt Fejer
Systems Administrator
Email: zsolt.fejer at orb-data.com
Switchboard: +44 (0) 1628 550450
Address: The Chapel, Grenville Court, Britwell Road, Burnham, SL1 8DF, United Kingdom
[cid:image001.gif at 01CBAD99.79D9CEB0]<http://www.orb-data.com/>                                               [cid:image002.jpg at 01CBAD99.79D9CEB0] <http://www.ibm.com/>

Orb Data Limited, registered in England No. 03429749
Registered Office, 29 Devizes Road, Swindon, Wiltshire, SN1 4BG, United Kingdom


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.shrew.net/pipermail/vpn-help/attachments/20110106/e6449f9b/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 2353 bytes
Desc: image001.gif
URL: <https://lists.shrew.net/pipermail/vpn-help/attachments/20110106/e6449f9b/attachment-0002.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 2536 bytes
Desc: image002.jpg
URL: <https://lists.shrew.net/pipermail/vpn-help/attachments/20110106/e6449f9b/attachment-0002.jpg>


More information about the vpn-help mailing list