I have an automated script that pulls backups from my website to my local computer. Once my server was down, another time i accidentally move my script. How do i make Windows Task Scheduler tell me with the script fails (or doesnt run/not found)? I dont care if a prompt comes up, an email or something that appears on my desktop. I want to be notified if something goes wrong. On my server crontab emails me about errors which is great. I want something like that on my windows 7 local computer.

link|improve this question

55% accept rate
feedback

1 Answer

up vote 5 down vote accepted

When a scheduled task fails to start, an event is written to the TaskScheduler event log:

Note: The Task Scheduler log is located at

 Computer Management
    System Tools
       Event Viewer
          Application and Services Logs
             Microsoft
                Windows
                   Task Scheduler
                      Operational

enter image description here

Windows lets you trigger scheduled tasks to start when a variety of events happen, e.g.:

  • time of day
  • system startup
  • user login
  • event recorded in event log

Armed with this knowledge, you can create a scheduled task that that runs when your scheduled task fails:

enter image description here

This scheduled task's action can then be set to something that sends you an alert - in your choice of methods (e.g. triggers a shutdown). You might just want it to send an e-mail:

enter image description here

This is how Windows handles everything. You can see many diagnostic tasks that trigger on an event appearing in the log. e.g. when an IP address conflict is detected, an event is written to the log:

  • Log: System
  • Source: Tcpip
  • Event ID: 4198

A scheduled task triggers on this event, and runs a program to tell you about it and to fix it.

link|improve this answer
+1. How do i get the event id? i TasKScheduler doesnt show up for me. I tried making a custom event using the advance button which had a nice UI to help. But at the end of it, it said request not available. Note i am using windows home premium – acidzombie24 Feb 22 '11 at 22:59
These screenshots are from Windows 7. Windows XP doesn't support it. Windows Vista: i don't know. What version of Windows do you have? – Ian Boyd Feb 22 '11 at 23:42
Ian Boyd: Windows7 "home premium". Here is what i see i.imgur.com/Qd8QN.png – acidzombie24 Feb 23 '11 at 0:10
That screenshot is the TaskManager, from inside the Task Scheduler. Do you see Task Scheduler in the Event Log? – Ian Boyd Feb 23 '11 at 3:18
You get the event id from the event log (203 and 103). You can see the event id's in the screenshot (203 and 103). Or i can tell you the event id's: 203 and 103. – Ian Boyd Feb 23 '11 at 3:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.