I am trying to setup a daily task (running CTest from a batch script). I have used the default GUI of my Vista Pro 32bits, and setup the following task:

> schtasks /query /tn "trunk nightly" /xml
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <Principal id="Author">
  <Actions Context="Author">

From the GUI, it tells me that the last run happened on the 24th, while today is the 28th, so clearly it runs properly for a couple of days and then stop. Is there a way to setup a daily windows tasks, that actually runs on daily basis ? My user has admin rights, has a password, and workstation is properly plugged (no power outage during the week end).

As can be seen from the XML output, the flag WakeToRun is properly set to true. From the power management system, I cannot however set the famous Allow wake timers (interface if in french but clearly the 4th parameters is missing, simply compare with this)

enter image description here

here is the same screenshot after I click on Change settings that are currently unavailable:

enter image description here

Clearly the code above does not make use of any UI at all at least it does not open anything when I right click 'execute' from the windows schedulers panel. It run smoothly when executed by hand.

It looks just as if a task cannot run when computer is asleep...

  • is it working when executed manualy (right click / start) ? can you test another time and see if it is OK when the computer is awake ? – Loïc MICHEL May 5 '14 at 13:54
  • Following on from @Kayasax's q, does the script have some UI interaction that won't work when the workstation is asleep ? – Angst May 5 '14 at 14:50
  • no UI interaction at all – malat May 6 '14 at 6:56
  • Set a start time for like 5 minutes from now then check your event logs. Could be a permissions issue for some reason or something else equally fun. Another thing I'd do to help troubleshoot: in the command that points to the script in schedtask add the line ">hpdesk_openjpeg_output.txt" to the end of that command. This would save the output to a text file as if you ran it straight from cmd - but using the scheduled task process which can sometimes cause fun behaviors you wouldn't catch otherwise. – Bradley Forney May 6 '14 at 12:55

You have to enable wake up timers in the power savings plan options:
Control Panel -> Power Options -> Change plan settings -> Change advanced power settings.
In the list, item Sleep, change Allow wake timers to Enable.

The GUI parameters for the scheduled task should include :

In the General tab:

  • Check Run whether user is logged in or not

In the Conditions tab:

  • Check Wake the computer to run this task.

If there is no Wake the computer to run this task checkbox, then most probably your BIOS or hardware do not support wake timers, which is why Windows will not display the option.

If that's the case, the only other idea I have is, if wake-on-LAN is supported, to maybe do the waking from another computer on the network.

  • Here is the documentation for Vista: support.microsoft.com/kb/929463 I do not see anything like what you described from my vista environment. – malat May 7 '14 at 7:02
  • It would be easier to fire up the Task Scheduler and check. – harrymc May 7 '14 at 8:28
  • let me rephrase my intial comment into: after searching in my vista installation I do not see anything called "Allow wake timers". Furthermore I took an extra (afterward) step to check online if I could find it, and I found the above link to microsoft documention. – malat May 7 '14 at 11:00
  • I don't have Vista, but this link shows how to reach "Allow wake timers" on Vista, and it's effectively different from Windows 7. If this works for you, I'll add it in my answer. – harrymc May 7 '14 at 11:20
  • I've added a screenshot (sorry it's in French) of what parameters I can change. 'Allow wake timers' is not among them. – malat May 7 '14 at 12:18

If you're unable to get the task scheduler to work for you, and, your task is started from sleep or hibernation, have a look at WakeOnStandby. It's free and it just might provide what you're looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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