I have a batch script test.bat and a text file log.txt which store errors of my test.bat.
I am using 2>> log.txt to store the errors at the end of my commands.
For example : mysql -u root -padmin -e "stop slave;" 2>> log.txt
And my log.txt display mysql is not recognized as an internal or external command so it's works fine.
I just want to know if it is possible to add the time before the error message in the log.txt like 20:51:23 mysql is not recognized as an internal or external command
I tried things like
%time%2>> log.txt
or
set time=%time%
time2>> log.txt
But it doesn't work. Any ideas ? Thanks in advance.