DOS Timer

From PeformIQ Upgrade
Jump to navigation Jump to search

BAT File

@ECHO OFF
for /F "tokens=2-4 delims=/ " %%a in ('date /t') do (set date=%%c%%b%%a)
for /F "tokens=1-3 delims=: " %%a in ('time /t') do (set time=%%a%%b%%c)
TaskLIST | FIND /i "SleepMilliseconds.exe" > NUL 2>&1
IF ERRORLEVEL 1 GOTO NOTRUNNING

:RUNNING
ECHO %date% %time% Failed to lauch SleepMilliseconds.exe A task of this name already exists in the task list >> sleeplog.log
GOTO END

:NOTRUNNING
ECHO %date% %time% Starting SleepMilliseconds.exe 10000 >> sleeplog.log
SleepMilliseconds.exe 10000
ECHO %date% %time% SleepMilliseconds.exe finished >> sleeplog.log
GOTO END

:END

This uses the program SleepMilliseconds.exe. And here is a copy of the BAT file.