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 www.blat.net.


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)
::———-x———
::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.

  Windows.zip (62.7 KiB, 145 hits)

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

Leave a Reply

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