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_DISCONNECTIn case of a successfully established connect (errorlevel = 0) you call the FTP? function of your batchfile.
: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.