> Is there a simple way to detect whether or not an internet connection is
It doesn't have to be all that time consuming. Specify some address that's extremely likely to be there, like your ISP's default router, and a timeout and one iteration, like| IPCONFIG /ALL will tell you if Windows **thinks** there's an internet
| connection. %_IP is probably just as good for that. But you won't
| know if it's usable until you try it ... @PING, perhaps.
Whether or not my cable modem is connected to my router the reports of
both IPCONFIG /ALL and ECHO %_IP are the same. @PING works, but is dependent
on the accessibility of the specified URL. One could try many, and if any
one works, assume the connection exists, but it is timeconsuming even for
Interestingly, the WinXP Control Panel applet "Network Connections"
detects a newly made connection, but does not detect disconnection. I'll try
to see if one of the NET.EXE subcommands can be used for this purpose.
ping -n 1 -w 1000 somewhere.close.com
you> | Short answer - No.
> | Long answer - You could use PING and see if you get a response from a
> | known server on the interwebs. Or COPY a known page from a web
> | server or FTP server.
> | I am assuming by "internet connection" you mean that you have a
> | valid LAN connection and IP address but you may or may not have a
> | valid WAN connection.
> Thanks for the reply. The issue is esp. pertinent to any mobile
> computer,e.g. a laptop computer with built-in WiFi. When you start it,
the> want to start browsers, mail clients, etc. only if you are connected to
> The problem with testing internet availability with PING or any
can> check against a single URL is that the specific URL may be down. OTOH I
> ping many sites, and on detecting the first response declare that I am
In the past, I have used something like:The problem with testing internet availability with PING or any other check against a single URL is that the specific URL may be down. OTOH I can ping many sites, and on detecting the first response declare that I am connected.
if %@ping[google.com,3] lt -1 if %@ping[microsoft.com,3] lt -1 abort No internet connection!
Hi,Is there a simple way to detect whether or not an internet connection is
v:\> tracert -d -h 2 ilucky Tracing route to lucky.syr.edu [188.8.131.52] over a maximum of 2 hops: 1 7 ms 5 ms 5 ms 10.236.192.1 2 15 ms 11 ms 12 ms 184.108.40.206 Trace complete. v:\> echo %@ping[220.127.116.11] 12