Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

checking log

1 view
Skip to first unread message

Smiles

unread,
Nov 26, 2009, 7:40:45 PM11/26/09
to
I suspected a problem and my previous log question solved it now how
would I prevent a double hit in a day

@echo off
echo %date% %time:~0,5% >> c:\Logfile.txt
@echo on
start task 1
start task 2
start task 3

Problem my wife is running this batch file every time she turns on the
computer
How would I like to do is check the last entry date to make sure it has
not been run that day and skip to end, I asked her to run it every other
day or once per week

thanks

Ted Davis

unread,
Nov 26, 2009, 8:04:43 PM11/26/09
to

@echo off
for /f "tokens=*" %%A in (logfile.txt) do set last_date=%%A
if "%date%"=="%last_date%" goto :EOF

Your original code follows that

--

T.E.D. (tda...@mst.edu)

Smiles

unread,
Nov 27, 2009, 8:54:32 AM11/27/09
to
thanks

Tom Lavedas

unread,
Nov 27, 2009, 10:08:24 AM11/27/09
to

Or maybe ...

@echo off>> c:\Logfile.txt
find "%date%" < c:\logfile.txt > nul || (
echo %date% %time:~0,5% >> c:\Logfile.txt)
__________________
Tom Lavedas

0 new messages