Search DJG Design

Constant Ping

I wrote this batch file because sometimes when you are using the windows native ping function you get an error:

This can be annoying if you know the device exists because you have to keep retyping the ping command, instead you can use the script below that will ping the specified device about once a second and even if it cant find the device, it will still carry on.
You can copy and paste the below code into a .bat file to use it yourself.


@echo off
SET /P PC=Computer:

:start
        ping %PC% -n 1 > NUL
        IF ERRORLEVEL 1 (
                ECHO No ping
        ) ELSE (
                ECHO Successful ping response
        )
rem Wait for a bit to slow down script
ping 1.1.1.1.1 > NUL
goto start


Sample output:


Last updated: 10th June 2010
Bookmark/Share this page

Comments:

Post a comment