MindDump. Photos. And random ramblings.

+menu -


Windows Command Line Ping Replacement

So the windows version of ping is really stupid.

I was writing a batch script to mount up a network share that involved checking to ensure my NAS unit was turned on. The script is scheduled to run after the computer resumes.

What I found out is that the built in version of Ping.exe is terrible at telling you whether the ping has returned successfully or not. I was checking the ERRORLEVEL – %ERRORLEVEL% variable to find out what ping was returning. It should be 0 for success and 1 or higher for a failure.

What I found was, i was getting replies from the local pc (dunno why, leave me a comment if you know) and ping was reporting a success even though the correct pc failed to reply. The solution?
Replace the Windows ping.exe with Fping. It has a lot more options and appears – from some initial quick tests – to correctly report the errorlevel.

Kudos to Wouter Dhondt for developing it. I’ll update this post with any more news!

 

image Fping vs Ping errorlevel return values

5 Responses to Windows Command Line Ping Replacement

  1. Nick Mailer says:

    It might be reasonable to ask why you need to be in Windows in the first place ;-)

  2. Have you tried running AutoCad 2010 in Linux?

  3. Nick Mailer says:

    No. And neither, I imagine, has Kirrus :-)

    This seems a worthy alternative:
    http://www.bricsys.com/en_INTL/bricscad/comparison.jsp

  4. @Nick, in case you didn’t see it, the above post was written by Garreth.. look out for the byline at the bottom of the post :)

    I need to modify the theme to put that more prominently at the top sometime..

  5. @Nick, read my next post on Beep music. It’s about linux ;) JK