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: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 


Messages In This Thread
[] - Bob - 05-19-2014, 10:43 PM
[] - husoski - 05-19-2014 10:52 PM

Forum Jump:


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