Tuesday, 27 August 2013

How do i break the loop when connection fails?

How do i break the loop when connection fails?

Im working on a ping batch program. What i wanna learn is how do i skip
the loop when the connection is dead? For an example:
@echo off
:1
ping www.stackoverflow.com
(I guess) if errorlevel 1 set errorlev=1
If errorlevel 1 goto 2
goto 1
:2
Echo ping failed!
Title ping failed!
color c

No comments:

Post a Comment