Hello,
I have read a bit but am still confused on the topic. My understanding is very basic, but I have wrote quite a few batch files to carry out a lot of different tasks and I was wondering if there is a way of getting the batch file to log this everytime it runs?
Thanks
Logging Batch File
Moderator: DosItHelp
Re: Logging Batch File
You could write a log file by ECHO redirection.
... where > creates/overwrites a file and >> appends to an existing file.
Regards
aGerman
Code: Select all
@echo off &setlocal
>test.log echo Hello
>>test.log echo World!
... where > creates/overwrites a file and >> appends to an existing file.
Regards
aGerman
Re: Logging Batch File
If you just want to log each time a batch file is run then you might try something like this:
echo File %0 run on %date% at %time%>>my_log.txt
Post back and re-phrase your question if your problem is not answered.
Best wishes!
echo File %0 run on %date% at %time%>>my_log.txt
Post back and re-phrase your question if your problem is not answered.
Best wishes!