Get emails from Scheduled task based on exit code

I have been assigned the task of getting scheduled task to send me a email if the exit code is not 0x0 however i have no clue on how to script it, I know i can use blat to send the email. If anyone can point me in the right direction on how to have a batch or vbscript check the exit status of a scheduled task and send a email please let me know.

I am assuming that the batch of vbscript that will be made will be called by the scheduled task.
navajo26354Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Shift-3Connect With a Mentor Commented:
IF ERRORLEVEL 1 will return true if the errorlevel is greater than or equal to 1.  See here for more information.
0
 
igor-1965Commented:
START <your application to run> /WAIT
IF ERRORLEVEL 1 START <your application to send emails about error>
0
 
navajo26354Author Commented:
is this windows batch or vb?
0
 
igor-1965Commented:
Windows. Save it as .cmd and schedule task to run it.
0
 
navajo26354Author Commented:
how can have it check for any error not just lvl 1
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.