Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rasdial batch file
Message
From
31/03/2010 09:14:53
Hee Lim Wang
Fantasy Software Enterprise
Malaysia
 
 
To
31/03/2010 02:52:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01458171
Message ID:
01458189
Views:
50
Thanks Thomas
but it cannot work, inside C:\TEMPrasftp.prt file shows
Remote Access error 623 - The system could not find the phone book entry for this connection.



when working with rasdial, you will have a look at alive.exe:
http://www.programfiles.com/Default.asp?LinkId=5739

It's a ping utility that returns an errorlevel and that is what you need for successful use of rasdial.

It has been a long time since my last use of RASDIAL. Sometime in 2002 if I remember correctly :-)

So...basically you'll have to define the variables and call rasdial like this:

set RAS_NAME=test.selfip.com
set RAS_USER=xyz
set RAS_PASSWORD=123456
set RAS_PRT=C:\TEMPrasftp.prt
rasdial %RAS_NAME% %RAS_USER% %RAS_PASSWORD% >>%RAS_PRT%

after this you have to check, if the connection was established and the target host is available. This should be done with alive.exe if you want to handle the complete job in your batch file.

SET TGT_HOST=SERVER.IP.ADRESS.OR.DNS.NAME
alive /repeat=30 %TGT_HOST% >>%RAS_PRT%
if %errorlevel% == 255 echo other errors
if %errorlevel% == 8 echo bad destination
if %errorlevel% == 7 echo ttl expired in transit
if %errorlevel% == 6 echo hardware error
if %errorlevel% == 5 echo destination port unreachable
if %errorlevel% == 4 echo destination protocol unreachable
if %errorlevel% == 3 echo destination network unreachable
if %errorlevel% == 2 echo destination host unreachable
if %errorlevel% == 1 echo request timed out
if %errorlevel% == 0 goto :FTP_MAKRO
goto :RAS_DISCONNECT

In case of a successfully established connect (errorlevel = 0) you call the FTP? function of your batchfile.

ending your rasdial connection is done like this:

:RAS_DISCONNECT
rasdial %RAS_NAME% /DISCONNECT >>%RAS_PRT%

However, those snippets above are part of a complete RASDIAL/ALIVE/FTP script and are roughly extracted.

>Hi
>How to write a batch file for rasdial ?
>dyndns is test.selfip.com
>user is xyz
>password is 123456
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform