Thursday, June 9, 2011

Simple timestamps generation script

timestamp.bat
date /T >> timestamp.log
time /T >> timestamp.log
choice /D Y /T # seconds between timestamps
timestamp.bat

it may be useful to check provided RPO value

1 comment:

  1. 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

    ReplyDelete