How to check Internet connection in a batch routine ?

Is there a way to check my ISP connection in a batch routine ?
e.g. an environment Variable ?
Further down in my batch script, I want to check the connection with an IF statement because I want the script to behave in different ways if I'm online or not.
If I could write the result of rasdial to a variable it would be great.
(rasdial without any parameters gives the following result: no connections (if you are not connected) and connected to "DialUpEntry" (if you are connected))
Looking forward for Any Help, Hints, batch lines.
Thanks in advance
mfuerlinger
LVL 1
mfuerlingerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
j2Connect With a Mentor Commented:
rasdial | find "No Connections"

Now %ERRORLEVEL% is 0 if the result is true (and you are not connected) and else it is 1
0
 
mfuerlingerAuthor Commented:
Thanks

Easy points....=> X-mas present

Merry X-mas, Happy New Century, Greetings from Stuttgart, Europe
0
 
j2Commented:
Gothenburg, Sweden "God jul" :)
0
All Courses

From novice to tech pro — start learning today.