BAT/CMD Script Log Generator

BAT/CMD scripts are very much helpful to do a monotonous job automatically and sometimes the outputs of the batch script file are very much required. We can generate log file from batch file, but we can’t get the 100% log within batch file, so I was looking for a tool which generate log files from a batch script. After a few search, finally I found a tiny utility called wtee.exe on wintee.

To use it properly, I have created a batch file with which u can execute any batch script, and after executing the batch file it will automatically archive the entire output log, also there is an option to send mail notification with the output file as mail attachment (optional). For sending mail notification I used blat.exe from

Default settings are follows…

REM Settings Start
::Set Destination, source drive, and restore folder
set LogPath=D:TCleanLog
set LogName=TempCleanLog
set LogExt=.log
set WinTee=wtee.exe
::Here specify your BAT/CMD Script File
set CallBAT=D:AutoTempCleanUp.bat
::E-Mail Settings (SMTP)
::If ‘yes’ a mail will be fired after backup
set _mailnotification=yes
::If ‘yes’ backup log will attached with mail
set attachment=no
::Type your e-mail address(for multiple e-mail ID, use ‘,’)
set email=To Mail Adress
:: Type from mail ID
set from=From Mail Address
::Set SMTP Server IP Address
set mserver=Your Mail Server IP
REM Settings End

Here is the complete script…

Download wtee.exe and blat.exe from following link and extract it to windows directory. (62.7 KiB, 259 hits)

Disclaimer: All posts and opinions on this site are provided AS IS with no warranties. These are our own personal opinions and do not represent our employer’s view in any way.

This article currently have 11,613 views

Follow me

CC BY-ND 4.0 This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.