A scheduled task is suspended unexpectedly, and the operating system resumes sleep when you select the “Wake the computer to run this task” option in Windows Vista or in Windows Server 2008
In Windows Vista or Windows Server 2008, you create a task in Task Scheduler, and then you select the Wake the computer to run this task option. This option makes sure that the computer wakes up from sleep or from hibernation to run the task. In this scenario, the scheduled task wakes up the computer as scheduled. However, 120 seconds later, the operating system resumes sleep or hibernation even if the scheduled task is running. Therefore, the scheduled task is suspended unexpectedly.
Note: The issue does not occur if the scheduled task calls the SetThreadExecutionState() function.
For more information on this issue, including potential causes, workarounds, and resolutions, see: Microsoft KB Article KB957473.