I'm scripting a big batch file.
It records the date to a log.txt file:
@echo off
echo %date%, %time% >> log.txt
echo Current date/time is %date%, %time%.
@pause
exit
It can record it several times, on several lines. Now what I want to do is that the batch file file shows the last recorded date/time from the log.txt file.
How?
type log.txt
But that will give you the whole file. You could change it to:
echo %date%, %time% >> log.txt
echo %date%, %time% > log_last.txt
...
type log_last.txt
to get only the last one.