Re: Simple Ping Script

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"K" <no@xxxxxxxx> wrote in message
news:ON0OqAJSJHA.4212@xxxxxxxxxxxxxxxxxxxxxxx
What are the errorlevels for the ping command?

I am trying to create a script that will ping a remote router, and in the
event it is non-responsive, will cause the machine the script is running
on to reboot without warnings or prompts.

Any help much appreciated.

Ping does not have any specific error levels. You need to check its output
in order to work out if the remote computer is responding, e.g. like so:

ping SomePC | find /i "bytes=" > nul && echo SomePC is responding.
or maybe
ping SomePC | find /i "bytes=" > nul || echo SomePC is not responding.


.



Relevant Pages

  • Re: Simple Ping Script
    ... I am trying to create a script that will ping a remote router, ... on to reboot without warnings or prompts. ... Ping does not have any specific error levels. ...
    (microsoft.public.windows.server.scripting)
  • RE: ICMP (Ping)
    ... Should ICMP echo requests be dropped? ... Responding to the requests tells script ... Subject: ICMP (Ping) ...
    (Security-Basics)
  • Re: [SLE] emailing myself when a ping command fails via crontab????
    ... but I have a perl script to monitor a webserver. ... First the script tries to ping it's DNS servers, ...
    (SuSE)
  • RE: ICMP (Ping)
    ... script to locate vulnerabilities(example point and case: ... Is it good to allow UDP ping packets? ... Guys again, I am not saying that you disable pings and walk away, job ... 300K and you guys are right, it port scans like a freaking demon. ...
    (Security-Basics)
  • Re: How to run script (sleep360) without delaying bootup
    ... I don't think they would mind Now the script you sent this morning which I don't have in front of me I would think could do the job. ... Maybe you could ping then see if there a command to dealy the time servers and then let them run. ... Pinging a server on the Internet isn't really the problem, ...
    (Fedora)