I have a python script that when I find an error I throw sys.exit(1). This results in the task scheduler showing a "(0x1)" comment under last run result. A successful run returns "The operation completed successfully. (0x0)". Unfortunately though this does not trigger the task to be run again even though under setting I have the "if task fails, restart every:" checkbox checked. Any thoughts on how to improve this?
Another post has the following answer but I can not find where to put the custom filter? under the four settings; Create a Basic Task, When an Event is Logged, Action,Finish
You can,
1 activate history for Schedule (if not already) 2 on a History "Action completed" right click "Attached Task to This Event..." 3 Set a custom filter like this:
*[System[(EventID=201)]] and *[EventData[Data[@Name='ResultCode']='1']]