BATCH compare or difference in time

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
novmar
Posts: 9
Joined: 09 Oct 2013 11:10

BATCH compare or difference in time

#1 Post by novmar » 09 Oct 2013 14:03

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

Endoro
Posts: 244
Joined: 27 Mar 2013 01:29
Location: Bozen

Re: BATCH compare or difference in time

#2 Post by Endoro » 09 Oct 2013 19:09


novmar
Posts: 9
Joined: 09 Oct 2013 11:10

Re: BATCH compare or difference in time

#3 Post by novmar » 11 Oct 2013 05:03

tnx

Post Reply