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
 
Ad

Advertisements

Joined
Feb 15, 2012
Messages
2
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top