Error Log using a batch file - TechRepublic
General discussion
March 23, 2011 at 01:24 AM
ma_sami

Error Log using a batch file

by ma_sami . Updated 15 years, 3 months ago

Hi,

I have a batch file which seraches for a text file and send as email attachement using smtp client sendemail.exe,below is the code for same.

for /f “tokens=* delims= ” %%a in (‘dir/b *.txt’) do (set str=%%a)

start sendemail -f frommail@domain.com -t tomail@domain.com -u Subject -m Message Body -s mail.domain.com -a %str% -xu UserName -xp Password

How can we create a log file and save the result either success or failure along with the error message?

This discussion is locked

All Comments