Test a network connection - if successful, ping returns the ip address.
Syntax PING [options] destination_hostOptions -w timeout Timeout in milliseconds to wait for each reply, default=4000. -i TTL Time To Live. -v TOS Type Of Service. -a Resolve addresses to hostnames. -n count Number of echo requests to send. -t Ping the destination host until interrupted. To see statistics and continue type Control-Break; To stop type Control-C. -l size Send buffer size (default=32). -f Set don’t Fragment flag in packet (IPv4-only). -r count Record route for count hops (IPv4-only). -s count Timestamp for count hops (IPv4-only). -j host_list Loose source route along host_list (IPv4-only). -k host_list Strict source route along host_list (IPv4-only). destination_host The name of the remote host -R Use routing header to test reverse route also (IPv6-only). -S srcaddr Source address to use. -4 Force using IPv4. -6 Force using IPv6.
A response of "Request timed out" means there was no response within the default time period of 4 seconds.
The IPv6 options are only available on versions of Windows that support IPv6, e.g. Windows 7 /2008
A successful PING does NOT always return an %errorlevel% of 0
Ping response times below 10 milliseconds often have low accuracy. A time of 10 milliseconds is roughly equal to a distance of 1860 Miles, travelling a straight line route at the speed of light, (or a round trip of 2 × 930 miles). From this you can see that ping response times will give a very very rough estimate of the distance to a remote host.
Network adminstrators do not appreciate frequent or continual pings to their servers, try not to overdo it!
How to test connectivity with ping:
How to create a timed delay with ping:
Ping a server just once:
Monitor a website (example.com) every 15 seconds:
@Echo offEcho Logging ping responses, press CTRL-C to stop:start Ping -n 1 example.com | find "TTL=" >>c:\pingtest.txt Echo . Ping -n 16 127.0.0.1>nulgoto start
The script above can be used to test an Internet connection, just replace example.com with your ISP's Default Gateway IP address. This represents the first physical device on the ISP's side of your connection. You can find the Default Gateway on your router status screen.
PING is named after the sound that a sonar makes.
“And now I see with eye serene