Page 1 of 1

BATCH compare or difference in time

Posted: 09 Oct 2013 14:03
by novmar
I need a batch script which, when run twice, create empty xxx.txt
Time between first and second start script is max 10 seconds.

I know how to...
...first batch start ... to create txt file with current time
...second batch start ... create xxx.txt file

@echo off
IF EXIST a.txt goto skip
) ELSE (
echo %time% > a.txt
EXIT
:skip
echo > xxx.txt
EXIT

I don't know how to compare time in a.txt with current time, and if difference less then 10 sec, that create xxx.txt, and if not that del a.txt
format time in a.txt: 21:53:10,13

Re: BATCH compare or difference in time

Posted: 09 Oct 2013 19:09
by Endoro

Re: BATCH compare or difference in time

Posted: 11 Oct 2013 05:03
by novmar
tnx