Findstr and Bmail

Joined
Feb 15, 2012
Messages
2
Reaction score
0
Hi,
I have a batch script as below, but I couldn't worked as success,
To Summarize ;
1. I have some xml files ( C:\copy )
2. I want to check them and if I find " FAILURE " string that script must be send mail or else nothing

Thanks / Regards



echo CheckTime: %date%-%time% >> C:\control.txt
CD C:\copy
findstr /C:"FAILURE" * >> C:\control.txt
if errorlevel == 1 (
echo "There is A Failure String In Xml File" >> C:\control.txt
GOTO SENDMAIL
)
GOTO EVERYTHINGISOK
:SENDMAIL
bmail -s *
echo MailSendTime: %date%-%time% >> C:\control.txt
:EVERYTHINGISOK
 
We've solved this problem as below,

@echo off
pushd c:\copy\
findstr /i "FAILURE" *.xml
if errorlevel 1 (
echo FAILURE not found
) ELSE (
bmail *********
)
popd
 
Back
Top