title: How to Trigger Windows Task Schedule restart after fails with python script
body: <p>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? </p>
  
  <p>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</p>
  
  <p>You can,</p>
  
  <p>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:</p>
  
  <p>*[System[(EventID=201)]] and *[EventData[Data[@Name='ResultCode']='1']]</p>