Page 1 of 1

runvpn.bat

Posted: 30 Sep 2008 05:33
by cjagdish69
I want to start my vpn connection from runvpn.bat file. The batch file should be as follows :

Check first whether any vpn connection exists. If yes then the batch file will do ftp process to some other server. If the vpn connection doesn't exist then the script will try to establish the vpn connection and then start the ftp process.

I want to do this bcos. if the vpn connection breaks due to any reason then i have to physically attend the machine and restart the vpn. As soon as the vpn connection breaks the ftp process stops. Hence if i am able to check whether the vpn connection is alive or not then if the connection is not alive then the batch file will make the connection alive and continue the ftp process. If it connection is alive then only the ftp process will go on.

For this purpose i have written the script as follows :
set kount=1
"c:\Program Files\Cisco Vpn\Vpn Connection\vpnclient.exe" connect "c:\Program Files\Cisco Vpn\Vpn Connection\Profiles\connectvpn" user abc pwd xyz nocertpwd

if %errorlevel% neq 200 goto failed

:start

ftp -s:ftp1.txt ftp_server_ip/name

kount+=

if kount neq 5 goto start

goto end

:failed

echo failed to connect with error = %errorlevel%
"c:\Program Files\Cisco Vpn\Vpn Connection\vpnclient.exe" connect "c:\Program Files\Cisco Vpn\Vpn Connection\Profiles\connectvpn" user abc pwd xyz nocertpwd
goto start
:end

There maybe some syntax errors. Can it be possible ? If yes, then kindly point me out where i am doing wrong.

- jagdish

Re: runvpn.bat

Posted: 11 Apr 2011 05:46
by woneeza
How do i create a proxy gateway for a vpn connection? I'm trying to setup a http or socks proxy which will route all traffic to a vpn connection. This is on linux.
___________________________
external keyword tool ~ keyworddiscovery.com

Re: runvpn.bat

Posted: 11 Apr 2011 10:27
by aGerman
Woneeza.

This is a forum for Windows Batch related topics. You cannot use Batch on Linux. Sorry, but for that reason your question is off topic or is there something I misunderstood?

Regards
aGerman

Re: runvpn.bat

Posted: 02 Jun 2011 01:10
by fugudona
dltd

Re: runvpn.bat

Posted: 02 Jun 2011 08:07
by nitt
woneeza wrote:How do i create a proxy gateway for a vpn connection? I'm trying to setup a http or socks proxy which will route all traffic to a vpn connection. This is on linux.
___________________________
external keyword tool ~ keyworddiscovery.com


Linux uses Bash, not Batch. >.>