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
runvpn.bat
Moderator: DosItHelp
Re: runvpn.bat
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
___________________________
external keyword tool ~ keyworddiscovery.com
Last edited by woneeza on 13 Apr 2011 00:32, edited 1 time in total.
Re: runvpn.bat
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
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
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. >.>