Discussion Locked

Command-line ping

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello folks,

I've got a command-line question.

I want to make a batch file that pings to a certain IP adress and after I got 4 positif reply's I want to start the next command.

vb:
*************************************
ping 10.10.1.1 ?????????????????
=> Time-out
=> Time-out
=> reply
=> Time-out
=> reply
=> reply
=> reply
=> reply
ftp 10.10.1.1
get file1
exit
**************************************

3 replies

by estebandelatorre

This is not quiete usefull, due to the fact that if you have a faulty line, the ftp won't get connect. The most reliable check will be on the file1 existance netx to the ftp session.
like:
:begin
del file 1 /y
ftp 10.10.1.1
get file 1
exit
ifexist file 1 then go oksoend
:rem the file 1 does not exist, try again
goto begin
:oksoend
echo File 1 is here!
exit

by ebvba

Thanks,

The above problem isn't because I've got a faulty line, buth I've got a ISDN router that needs to dial and connect before I can use the ftp command.

Buth I think that If I do the following:

ping 10.10.1.1
:begin
del file file1.dat/y
ftp 10.10.1.1
get file1.dat
exit
if exist file1.dat then go oksoend
:rem the file1.dat does not exist, try again
goto begin
:oksoend
echo file1.dat is here!
exit

This discussion is closed to new replies.