VPN, RASDIAL, & Error 781

G

Guest

I use a scheduled batch file to create a VPN connection during off hours to
my remote branch offices. Every once in awhile I get a 781 error in the log
file created when the batch file runs. I know that in my case the 781 error
is due to line problems and not authentication problems. What I would like to
do is test for the error in my batch file and retry if i get the 781 error. I
have a problem in coming up with the right syntax to get this to work. Here
is what I have so far.....

:start
rasdial vpnconnection username password
if errorlevel 781 goto start

If that code works I then map drives and copy files and finally disconnect.
I'm just not sure if my error testing is synatically correct. Any help would
be appreciated. Thanks, Mike Lawson
 
R

Robert L [MS-MVP]

You may want to use if This command IF ERRORLEVEL 1 ... meaning if the error level = 1 or larger. or check these pages for the details.

Errorlevel Commend

DOS Errorlevel command
The combination of the two or more IF ERRORLEVEL or nested IF Errorlevel statements
Testing a specific error level using If errorlevel command


Bob Lin, MS-MVP, MCSE & CNE
Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net
How to Setup Windows, Network, VPN & Remote Access on http://www.HowToNetworking.com
I use a scheduled batch file to create a VPN connection during off hours to
my remote branch offices. Every once in awhile I get a 781 error in the log
file created when the batch file runs. I know that in my case the 781 error
is due to line problems and not authentication problems. What I would like to
do is test for the error in my batch file and retry if i get the 781 error. I
have a problem in coming up with the right syntax to get this to work. Here
is what I have so far.....

:start
rasdial vpnconnection username password
if errorlevel 781 goto start

If that code works I then map drives and copy files and finally disconnect.
I'm just not sure if my error testing is synatically correct. Any help would
be appreciated. Thanks, Mike Lawson
 
G

Guest

Robert, thanks for your help but your reply leaves many questions.

1. What does "You may want to use if This command" mean?
2. "or check these pages for the details". What 'pages' are you refering to?
The web page links?
3. The four, one line, phrases you have listed; " Errorlevel Commend", "DOS
Errorlevel command", etc.; are the recommended phrases to search on? It's
very unclear.

I guess my basic question would be; will the code I have listed detect a 781
error and cause rasdial to execute again until such time as no 781 error is
detected?

Thanks, Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top