cmd - Ping Test Batch File to Text Output of Results -


i wrote simple .bat file pings 6 ip addresses on start , pauses window can go through , make sure each responding.

i wondering if possible create output .txt file simplifies results. instead of output of like:

pinging www.google.com [74.125.226.17] 32 bytes of data: reply 74.125.226.17: bytes=32 time=9ms ttl=51 reply 74.125.226.17: bytes=32 time=9ms ttl=51 reply 74.125.226.17: bytes=32 time=9ms ttl=51 reply 74.125.226.17: bytes=32 time=9ms ttl=51  ping statistics 74.125.226.17:     packets: sent = 4, received = 4, lost = 0 (0% loss), approximate round trip times in milli-seconds:     minimum = 9ms, maximum = 9ms, average = 9ms 

in .txt file read "%servername% online , responsive" or "%servername% not responsive," when reporting packet loss.

i'm not sure if possible simple batch file if not, can point me in right direction of language?

set "servername=www.google.com" ping %servername% |find "ttl" >nul && echo %servername% online || echo %servername% offline 

you may want play pings parameters /n , /w


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -