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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

j2Commented:
rasdial | find "No Connections"

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.