This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to check internet connection through a batch file and trigger a acrion if connection is found?
05-19-2014, 10:36 PM
Post: #1
how to check internet connection through a batch file and trigger a acrion if connection is found?
how to check internet connection through commands of command prompt whenever computer is started ?
if internet connection is available then i want trigger a action i.e. i want run another command
if internet connection is not available then again check of connection should be made after few minutes
i want all this to happen in BACKGROUND through a batch file

Ads

Find all posts by this user
Quote this message in a reply
05-19-2014, 10:43 PM
Post: #2
 
ping internic.net, if you get a reply then you are on the internet

Ads

Find all posts by this user
Quote this message in a reply
05-19-2014, 10:52 PM
Post: #3
 
Batch won't really run "in the background". It always has a console window. You can set up a shortcut to your batch file that starts minimized, but it will show up on your task bar.

But, like the other answer said, ping a known domain name with something like:

ping -n 2 google.com >nul
if errorlevel 1 goto NO_INTERNET

That will fail, though, if your ISP or some firewall or gateway along the way discards ICMP packets. Where I work, no pings or tracerts make it out of the local network.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)