views:

915

answers:

1

Hello,

I am working with Windows 7 and I have an application that returns zero (0x0) when successful and one (0x1) on error situations.

I have scheduled this app using Windows Task Scheduler. I have checked the option boxes "If the task fails, restart every" and "Attempt to restart up to:".

I thought that a non-zero return code from the app would be enough to trigger the task to be restarted after the given interval. But nothing happens.

Any ideas what could be the issue? I tried to google it but did not found anything relevant.

A: 

Hi!

I've experienced the same problem on a Windows 2008 server Windows Task Scheduler. The action return a non zero code but the scheduler consider the task completed:

Task Scheduler successfully completed task "\SET Tasks\Scheduled task [Backup SET Server]" , instance "{...}" , action "C:\Windows\SYSTEM32\cmd.exe" with return code 1.

I've found on the web only one answer:

The Windows Task Scheduler does not examine the exit code or any other values when your task completes. You must handle any error processing within your own script or program.

...in this document: www.onlinetoolworks.com/docs/winTaskSched.doc

So I think now that the only way to workaround this problem may be to use task triggering on event. I'm investigating.

Regards,

Olivier.

Olivier
I did not manage to make it work with task triggering on event.
Olivier