Scheduled tasks don't execute when initiated sleep from command line

0

I have the problem that scheduled tasks will only cause the pc to weak up from sleep, if the PC has been put to sleep with the GUI manually.

However if I use the command line to suspend the computer the computer will not wake up and the scheduled task will not execute.

I already tried all of the below commands:

  1. %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState

  2. %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Standby

  3. powercfg -hibernate off and %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState 0,1,0

None of those commands works like the GUI does! I also tried forcing S1 instead of S3 sleep in the BIOS. This did not help either. OS is Windows XP. This is perfectly reproducible and very annoying.

How can I suspend the computer from the command line, so it wakes up when a scheduled task is run?

user643011

Posted 2013-03-31T02:50:37.293

Reputation: 1 454

Answers

0

I have found a solution: psshutdown -d -t 0 works!

You can download it here.

user643011

Posted 2013-03-31T02:50:37.293

Reputation: 1 454

0

shutdown /h has worked for me for years. (C:\Windows\System32\shutdown.exe)

robert4

Posted 2013-03-31T02:50:37.293

Reputation: 141

1Do scheduled tasks wake the computer afterwards? – Daniel Beck – 2013-04-29T07:24:00.113

@DanielBeck: Yes. Another thing is that in the last few months my Win8 x64 does not execute the task after waking up from hibernation at the prescribed time. I don't know if it's specific to my computer. Maybe I should file it as a separate question? I worked around it by scheduling twice (7:30 and 7:32) with Do not start a new instance setting. – robert4 – 2013-05-30T12:54:58.333