Announcement

Collapse
No announcement yet.

email notification based on scheduled task exit code

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • email notification based on scheduled task exit code

    HI everybody,

    I've got a batch which runs through a scheduled task.

    Now, I would like to receive a email notification ( I may use local smtp or blat program...it doesn't matter) based on exit code of the task which has just been executed.

    for example, if task returns an exit code with value 0x0, so I receive an email with subject: "taskname" status:OK
    If task gives any other exit code than 0x0, so I receive a mail with subject:
    taskName status: KO

    Anyone could help me with that?

    Thanks in advance.

  • #2
    Re: email notification based on scheduled task exit code

    All scheduled tasks write to a log file.

    The file is called Schedlgu.txt and sits in C:\Windows\Tasks although if you try to look for this file in Windows Explorer it will say it doesn't exist.

    However, if you do a DIR from a command prompt from C:\Windows\Tasks it appears and you can see it.

    You may need to configure a batch file or VBS file to monitor Schedlgu.txt and perform your required actions based on the exit codes of your tasks.

    MS article on troubleshooting Scheduled Tasks

    Hope this helps.

    Hanley

    Last edited by Hanley; 6th November 2009, 12:22.

    Comment

    Working...
    X