Auto connect to VPN when connection is lost


I have a SBS 2003 server (server 1) connection to a 2003 R2 Server (server 2) via VPN. The line works well, but occasionally the connection is dropped due to restart of the target server (Server 2).

I have checked the box (redial if line is dropped) in the VPN configuration, but this does not do anything, when the target server is restarted. Probably because of the long period of time (about 10 min.). Then we have to etablish the connection again manually.

Is there somewhere, where I can aks the connection to always redial?

If this is not possible I am thinking about making a script and make it run each 10 minutes from the taskmanager. This script shuld check if there is a connection - and if not dial up the connection. The script is probably pretty simple, but I don't know anything about making scripts. Can anyone help me?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can use "rasdial VPNNAME USER PASSWORD"

A script could look like this if your vpn will creates a new IP starting with 192.168.10. This will check the connection every 30 sec.

ipconfig | findstr "196.168.10"
if %ERRORLEVEL% == 0 goto :wait
sleep 30
goto start
sjallerAuthor Commented:

I have made a scriptfile like you suggested with succes. ONLY I HAD TO MAKE ONE CHANGE since the command "sleep 30" does not exist. I replaced the command with the following "fake command just to make it wait - each line takes 5 seconds to process, so now i waits for 30 seconds"

ping -n 1 -w 5000 >NUL
ping -n 1 -w 5000 >NUL
ping -n 1 -w 5000 >NUL
ping -n 1 -w 5000 >NUL
ping -n 1 -w 5000 >NUL
ping -n 1 -w 5000 >NUL

If you agree with my method, please post again with corrected script, then I will accept that as solution.
Yes, I'm sorry that sleep did not work. The command sleep a part of Windows 2003 Resource Kit which i happened to have installed. Your solution is good enough and you can find a similar solution at:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.