@Echo off
SETLOCAL EnableDelayedExpansion
FOR /F "skip=1" %%A IN ('WMIC OS GET LOCALDATETIME') DO (SET "t=%%A" & GOTO break_1)
:break_1
SET OUT=0F
color %OUT%
mode 44,20
echo mode 44,20
echo off & cls
Title = Ping Monitor
set IP=1.1.1.1
:top
set mydate=%date%
PING -n 1 %IP% | FIND "TTL=" >nul >> PingLog.txt
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 3 -w 500 127.0.0.1 >nul
GoTo top
I can't figure out how to do some changes. I would like to change the time format to a 12-hour clock instead of 24-hour clock.
I would also like to have it make a sound, like a wave file, when it turns red, because it's lost connection or long ping time intervals.
I have three different files that work fine but I can't get it to work all in one file.
I've tried so many different things To no avail. Any help would be deeply appreciated.
Thanks ahead of time.
SETLOCAL EnableDelayedExpansion
FOR /F "skip=1" %%A IN ('WMIC OS GET LOCALDATETIME') DO (SET "t=%%A" & GOTO break_1)
:break_1
SET OUT=0F
color %OUT%
mode 44,20
echo mode 44,20
echo off & cls
Title = Ping Monitor
set IP=1.1.1.1
:top
set mydate=%date%
PING -n 1 %IP% | FIND "TTL=" >nul >> PingLog.txt
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 3 -w 500 127.0.0.1 >nul
GoTo top
I can't figure out how to do some changes. I would like to change the time format to a 12-hour clock instead of 24-hour clock.
I would also like to have it make a sound, like a wave file, when it turns red, because it's lost connection or long ping time intervals.
I have three different files that work fine but I can't get it to work all in one file.
I've tried so many different things To no avail. Any help would be deeply appreciated.
Thanks ahead of time.