I have a task set up to wake the computer from sleep at a specified time each day. Windows 10 Task scheduler is set to run a .bat file (“echo hello”) as admin with the “wake computer to run task” condition enabled. If I put the computer to sleep via the power menu, I get different results depending on which computer I am running it on.
On a Dell Optiplex 960, Bios A18, the task causes the light on the tower to stop flashing and the keyboard to light up, but the screen doesn’t not come back on. I’ve tried it with a sound file and there is no audio, but on manual wake via the keyboard, media player is open and the file appears to have played.
On a Biostar N68s3+, nothing happens and Task Scheduler says “The operator or administrator refused the request.”
On a Ryzen 5xx, it works perfectly.
I’ve turned on every power and wake function I can find in Windows and the bios. Does this have something to do with the older boxes not technically supporting windows 10? Is there a feature I should be looking for on new boards? I’ve spent hours on this and it’s driving me nuts. Unless there’s a much better tool to do this, I’d like to stick with Task Scheduler to prevent resource load and because it will be a lot of on/off events throughout the day. My arcade thanks you in advance.
Following these instructions: https://www.groovypost.com/howto/schedule-wake-sleep-windows-automatically/
Sleep.xml:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2021-08-19T10:40:52.0677749</Date>
<Author>RIKER\Admin</Author>
<URI>\Sleep</URI>
</RegistrationInfo>
<Triggers>
<TimeTrigger>
<StartBoundary>2021-08-23T14:30:00</StartBoundary>
<Enabled>true</Enabled>
</TimeTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-1800914523-2772139078-3296455877-1001</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>"C:\BAT files\sleep.bat"</Command>
</Exec>
</Actions>
</Task>
Sleep.bat:
Rundll32.exe Powrprof.dll,SetSuspendState sleep
Wake.xml:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2021-08-19T10:41:17.49175</Date>
<Author>RIKER\Admin</Author>
<URI>\Wake</URI>
</RegistrationInfo>
<Triggers>
<TimeTrigger>
<StartBoundary>2021-08-23T14:35:00</StartBoundary>
<Enabled>true</Enabled>
</TimeTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-1800914523-2772139078-3296455877-1001</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>true</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>"C:\BAT files\wake.bat"</Command>
</Exec>
</Actions>
</Task>
Wake.bat: echo hello
I've done so many combinations of tests on 5 machines, so I'm starting to get confused.
The sleep task always works. The put to sleep via the sleep task, the wake task works inconsistently between machines, waking some of them (but not the screen) and not waking others (including a Ryzen 5). The ones that do wake seem to go back to sleep a minute later.
When put to sleep via the start menu, the wake task wakes the two newer machines (screen included), and wakes two other machines (but not the screen). None of those machines go back to sleep a minute later.
One machine didn't wake regardless of if it was a sleep task or start menu sleep.
When using KM Wakeup, all machines sleep and wake properly, screens included.
Hibernate is off (powercfg -h off), wake timers are enabled on all power modes. I've updated bios and chipset firmware, and checked bios power/alarm options.
My next step is to try this as maybe there is an issue with Rundll32.exe: Task Scheduler won't wake the computer