Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rasdial batch file
Message
De
31/03/2010 02:52:12
 
 
À
31/03/2010 01:22:00
Hee Lim Wang
Fantasy Software Enterprise
Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01458171
Message ID:
01458174
Vues:
55
Hi,

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
Best Regards
-Tom

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.

Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform