runvpn.bat

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
cjagdish69
Posts: 1
Joined: 30 Sep 2008 03:36

runvpn.bat

#1 Post by cjagdish69 » 30 Sep 2008 05:33

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

woneeza
Posts: 1
Joined: 08 Apr 2011 04:35

Re: runvpn.bat

#2 Post by woneeza » 11 Apr 2011 05:46

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
Last edited by woneeza on 13 Apr 2011 00:32, edited 1 time in total.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: runvpn.bat

#3 Post by aGerman » 11 Apr 2011 10:27

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

fugudona
Posts: 1
Joined: 28 May 2011 01:07

Re: runvpn.bat

#4 Post by fugudona » 02 Jun 2011 01:10

dltd
Last edited by fugudona on 03 Jun 2011 23:28, edited 1 time in total.

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

Re: runvpn.bat

#5 Post by nitt » 02 Jun 2011 08:07

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. >.>

Post Reply