another timestamps generating script showing seconds and perfroming ping to the assigned IP:
echo off
REM Current Date date /T >> timestamp.log
REM Current Time call :CurrentTime hours mins secs hsecs echo %hours%:%mins%:%secs%.%hsecs% >> timestamp.log
REM set the IP address to ping ping 10.1.254.253 -n 1 >> timestamp.log
REM Set the time interval in seconds between the time stamps choice /D Y /T 5
echo ------------------- >> timestamp.log
timestamp.bat goto :EOF
:CurrentTime hh nn ss tt setlocal ENABLEEXTENSIONS for /f "tokens=5-8 delims=:. " %%a in ('echo/^|time') do ( set hh=%%a&set nn=%%b&set ss=%%c&set cs=%%d) if 1%hh% LSS 20 set hh=0%hh% endlocal&set %1=%hh%&set %2=%nn%&set %3=%ss%&set %4=%cs%&goto :EOF
another timestamps generating script showing seconds and perfroming ping to the assigned IP:
ReplyDeleteecho off
REM Current Date
date /T >> timestamp.log
REM Current Time
call :CurrentTime hours mins secs hsecs
echo %hours%:%mins%:%secs%.%hsecs% >> timestamp.log
REM set the IP address to ping
ping 10.1.254.253 -n 1 >> timestamp.log
REM Set the time interval in seconds between the time stamps
choice /D Y /T 5
echo ------------------- >> timestamp.log
timestamp.bat
goto :EOF
:CurrentTime hh nn ss tt
setlocal ENABLEEXTENSIONS
for /f "tokens=5-8 delims=:. " %%a in ('echo/^|time') do (
set hh=%%a&set nn=%%b&set ss=%%c&set cs=%%d)
if 1%hh% LSS 20 set hh=0%hh%
endlocal&set %1=%hh%&set %2=%nn%&set %3=%ss%&set %4=%cs%&goto :EOF