Damon Cortesi's blog

Musings of an entrepreneur.

ping_monitor.bat

| Comments

My web host went down unexpectedly a little while ago. For record keeping in case I decided to get nit-picky and ask for a pro-rated payment (I didn’t, JohnCo is an excellent service provider), I wanted to document when it came back online. I whipped up a short little batch script which I have modified to be more generic so I can use it for any downed host.

@ECHO OFF :START ping -n 1 %1% | find “Reply from ” if ERRORLEVEL 1 (GOTO START) ELSE GOTO DONE

:DONE time /t echo Back up!

Note that in the actual script, I put a BEL character (Ctrl-G) in the last echo statement for a little extra flare. I was a little bit at a loss as to how to do this at first, but luckily my editor of choice allows you to insert a literal character by presing Ctrl+I and then whichever character you want to insert.

Comments