<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>@font-face {
font-family: Cambria Math;
}
@font-face {
font-family: Calibri;
}
@font-face {
font-family: Tahoma;
}
@font-face {
font-family: Verdana;
}
@page WordSection1 {margin: 72.0pt 72.0pt 72.0pt 72.0pt; }
P.MsoNormal {
MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
LI.MsoNormal {
MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
DIV.MsoNormal {
MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
P.MsoAcetate {
MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Tahoma","sans-serif"; FONT-SIZE: 8pt
}
LI.MsoAcetate {
MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Tahoma","sans-serif"; FONT-SIZE: 8pt
}
DIV.MsoAcetate {
MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Tahoma","sans-serif"; FONT-SIZE: 8pt
}
SPAN.EmailStyle17 {
FONT-FAMILY: "Calibri","sans-serif"; COLOR: windowtext
}
SPAN.BalloonTextChar {
FONT-FAMILY: "Tahoma","sans-serif"
}
.MsoChpDefault {
}
DIV.WordSection1 {
}
</style>
<meta name="GENERATOR" content="MSHTML 8.00.6001.18999">
<style id="owaTempEditStyle"></style><style title="owaParaStyle"><!--P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body lang="EN-GB" link="blue" vlink="purple" ocsi="x">
<div style="FONT-FAMILY: Calibri; DIRECTION: ltr; COLOR: #000000; FONT-SIZE: 13px">
<div>Sure. Use</div>
<div><font size="2" face="calibri"></font> </div>
<div>"C:\Program Files\ShrewSoft VPN Client\ipsecc.exe" -r ConnName -u User -p Password -a</div>
<div dir="ltr"><font color="#000000" size="2" face="Calibri"></font> </div>
<div dir="ltr"><font color="#000000" size="2" face="Calibri">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:</font></div>
<div dir="ltr"><font size="2" face="calibri"></font> </div>
<div dir="ltr"><font size="2" face="calibri">@echo off</font></div>
<div dir="ltr"><font size="2" face="calibri">:loop</font></div>
<div dir="ltr"><font size="2" face="calibri">start /w "Shrew"
<div>"C:\Program Files\ShrewSoft VPN Client\ipsecc.exe" -r ConnName -u User -p Password -a</div>
</font></div>
<div dir="ltr"><font size="2" face="calibri">ping -n 6 127.0.0.1 >nul</font></div>
<div dir="ltr"><font size="2" face="calibri">goto loop</font></div>
<div dir="ltr"><font size="2" face="calibri"></font> </div>
<div dir="ltr"><font size="2" face="calibri">(The ping is used to implement a 5 second grace period for stopping the batch).</font></div>
<div dir="ltr"><font size="2" face="calibri"></font> </div>
<div dir="ltr"><font size="2" face="calibri">Clemens Hoffmann</font></div>
<div dir="ltr"><font size="2" face="calibri"></font> </div>
<div style="DIRECTION: ltr" id="divRpF643954">
<hr tabindex="-1">
<font color="#000000" size="2" face="Tahoma"><b>Von:</b> vpn-help-bounces@lists.shrew.net [vpn-help-bounces@lists.shrew.net] im Auftrag von Zsolt Fejer [Zsolt.Fejer@orb-data.com]<br>
<b>Gesendet:</b> Donnerstag, 6. Januar 2011 13:01<br>
<b>An:</b> vpn-help@lists.shrew.net<br>
<b>Betreff:</b> [vpn-help] Connect to VPN from Command line (Win7)<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Is there any way to connect to a VPN via Command Line? Either cmd script or Powershell.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I have a pretty unreliable network and it’d be good to monitor the connection and reconnect whenever it drops the line.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">regards</p>
<div>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #ff9933 2.25pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 4pt">
<p class="MsoNormal"><b><span style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 7.5pt">Zsolt Fejer</span></b><span style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 7.5pt">
</span><br>
<span style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #666666; FONT-SIZE: 7.5pt">Systems Administrator
</span></p>
<p style="LINE-HEIGHT: 105%" class="MsoNormal"><b><span style="LINE-HEIGHT: 105%; FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #666666; FONT-SIZE: 7.5pt">Email</span></b><span style="LINE-HEIGHT: 105%; FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #666666; FONT-SIZE: 7.5pt">:
zsolt.fejer@orb-data.com <br>
<b>Switchboard</b>: +44 (0) 1628 550450 <br>
<b>Address</b>: The Chapel, Grenville Court, Britwell Road, Burnham, SL1 8DF, United Kingdom
</span><span style="LINE-HEIGHT: 105%; FONT-FAMILY: 'Times New Roman','serif'; FONT-SIZE: 12pt"></span></p>
<p class="MsoNormal"><a href="http://www.orb-data.com/" target="_blank"><span style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: blue; FONT-SIZE: 12pt; TEXT-DECORATION: none"><img id="_x0000_i1026" border="0" alt="www.orb-data.com" src="cid:image001.gif@01CBAD99.79D9CEB0" width="99" height="50"></span></a><span style="FONT-FAMILY: 'Times New Roman','serif'; FONT-SIZE: 12pt">
</span><a href="http://www.ibm.com/" target="_blank"><span style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: blue; FONT-SIZE: 12pt; TEXT-DECORATION: none"><img id="_x0000_i1025" border="0" alt="IBM Premier Business Partner" src="cid:image002.jpg@01CBAD99.79D9CEB0" width="78" height="50"></span></a><span style="FONT-FAMILY: 'Times New Roman','serif'; FONT-SIZE: 12pt"></span></p>
</div>
</div>
<p class="MsoNormal"><br>
<span style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #666666; FONT-SIZE: 7.5pt">Orb Data Limited, registered in England No. 03429749
<br>
Registered Office, 29 Devizes Road, Swindon, Wiltshire, SN1 4BG, United Kingdom </span>
</p>
<p class="MsoNormal"> </p>
</div>
<br>
______________________________________________________________________<br>
This email has been scanned by the MessageLabs Email Security System.<br>
For more information please visit http://www.messagelabs.com/email <br>
______________________________________________________________________<br>
</div>
</div>
</body>
</html>