researchelf
asked on
Suppress Ping Statistics on Windows
How can I suppress the ping statistics on a Windows machine when using ping from the command line?
Suppress? In what way? I think we need more to go on here.. what are you trying to achieve?
ASKER
I am trying to achieve only two lines of output when I use the following command:
ping -a -n 1 <ipaddr>
So the ideal output would be:
Pinging computername.com [<ipaddr>] with 32 bytes of data
Reply from <ipaddr>: bytes=32 time=4ms TTL=250
Instead of
Pinging computername.com [<ipaddr>] with 32 bytes of data
Reply from <ipaddr>: bytes=32 time=4ms TTL=250
Ping statistics for <ipaddr>:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 4ms, Average = 4ms
ping -a -n 1 <ipaddr>
So the ideal output would be:
Pinging computername.com [<ipaddr>] with 32 bytes of data
Reply from <ipaddr>: bytes=32 time=4ms TTL=250
Instead of
Pinging computername.com [<ipaddr>] with 32 bytes of data
Reply from <ipaddr>: bytes=32 time=4ms TTL=250
Ping statistics for <ipaddr>:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 4ms, Average = 4ms
you mean you want to restrict the ping to 2 counts?
ping -n 2 "ipaddress"
If you want only 1 response, then you have it right..
Example pinging my gateway:
ping -n 1 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=1ms TTL=64
Ping statistics for 192.168.1.1:
Packets: Sent = 1, Received = 1, Lost = 0 (0
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
ping -n 2 "ipaddress"
If you want only 1 response, then you have it right..
Example pinging my gateway:
ping -n 1 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=1ms TTL=64
Ping statistics for 192.168.1.1:
Packets: Sent = 1, Received = 1, Lost = 0 (0
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great job. I didn't think to look for a unique word. I was daisy-chaining pipes to exclude all the words I didn't want. Thanks a bunch!
Nice one Lee. Wasn't aware of that one either.