Below is my code i am using right now, it is working but the second if command is reporting the down when there is no down, please help me and point out where i did mistake,
echo on
setlocal
set itemail= "mail id"
C:
cd\
cd batch
Call utltest.cmd >status.txt
ServerTester.exe -services acgenpszrwbklquf >>status.txt
if %errorlevel%==0 (
wmailto mailid -s"UP - Health Monitoring." -tstatus.txt"
) else (
c:
cd\
cd batch
Call utltest.cmd >status.txt
ServerTester.exe -services acgenpszrwbklquf >>status.txt
)
if %errorlevel%==0 (
wmailto mailid -s"UP - Health Monitoring." -tstatus.txt"
) else (wmailto %itemail% -s"DOWN - WebServices Health Monitoring." -tstatus.txt
)
:eof