Get emails from Scheduled task based on exit code

Posted on 2009-04-03
Last Modified: 2013-11-30
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.
Question by:navajo26354
  • 2
  • 2
LVL 14

Expert Comment

ID: 24061909
START <your application to run> /WAIT
IF ERRORLEVEL 1 START <your application to send emails about error>

Author Comment

ID: 24062240
is this windows batch or vb?
LVL 14

Expert Comment

ID: 24062381
Windows. Save it as .cmd and schedule task to run it.

Author Comment

ID: 24063142
how can have it check for any error not just lvl 1
LVL 38

Accepted Solution

Shift-3 earned 500 total points
ID: 24063855
IF ERRORLEVEL 1 will return true if the errorlevel is greater than or equal to 1.  See here for more information.

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now