Skip to content

Instantly share code, notes, and snippets.

@adinata-id
Created April 12, 2022 08:44
Show Gist options
  • Save adinata-id/be5fc6d693f16dd7288482813c4700d2 to your computer and use it in GitHub Desktop.
Save adinata-id/be5fc6d693f16dd7288482813c4700d2 to your computer and use it in GitHub Desktop.
ping monitor script batch file
@echo off
SET OUT=0F
color %OUT%
mode 44,20
echo mode 44,20
echo off & cls
Title = Ping monitor
set /p IP=Enter your IP Address :
:top
set mytime=%time:~0,2%_%time:~3,2%_%time:~6,2%
set mydate=%date%
PING -n 1 %IP% | FIND "TTL=" >nul
IF ERRORLEVEL 1 (SET OUT=4F & echo %mydate% : %time:~0,2%:%time:~3,2%:%time:~6,2%% : Down & Title Down %IP%) ELSE (SET OUT=2F & echo %mydate% : %time:~0,2%:%time:~3,2%:%time:~6,2%% : Up & Title Up %IP%)
color %OUT%
ping -n 2 -l 10 127.0.0.1 >nul
GoTo top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment