New
#1
Logging bat files, how?
Hey guys
I want to log the outcome/what happens when I run a .bat file in startup.
How do I do it?
Am not interested in pausing it, just create a log file.
// Chris
Hey guys
I want to log the outcome/what happens when I run a .bat file in startup.
How do I do it?
Am not interested in pausing it, just create a log file.
// Chris
you could put some 'echo' lines in the .bat file before/after important steps/choices like:
.....
echo "important event 1"
....
echo "important event 2"
......
and run the .bat file with redirecting output to a log file:
NameOf.bat >file.log
Just as a small pointer:
NameOf.bat > file.log would overwrite that log with every run. If you want a log over a longer period you just need to use 2 "chevrons":
NameOf.bat >> file.log
-DG
Ok, cool! Thanks a lot guys! That certainly does help
You can even use the chevron / double chevron trick inside the batchfile eg:-
echo "Start Test" >testlog.txt
.
.
do test
echo "Test Complete" >>testlog.txt