Link to home
Start Free TrialLog in
Avatar of researchelf
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?
Avatar of Fatal_Exception
Fatal_Exception
Flag of United States of America image

Suppress?  In what way?  I think we need more to go on here..  what are you trying to achieve?
Avatar of researchelf
researchelf

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

ASKER CERTIFIED SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.