Sei sulla pagina 1di 2

After upgrading to Windows 10, the computer in my bedroom kept waking me up at 3

AM. Disabling Wake the computer on the Microsoft\Windows\UpdateOrchestrator\Rebo


ot scheduled task didn't help. Windows turns the flag back on periodically. Even
disabling "Disable wake timers" in Power Options didn't help. The UpdateOrchest
rator kept orchestrating midnight alarms.
As a solution I've added a powershell script that removes wake settings every ho
ur.
To allow running powershell scripts: run powershell as administrator, and ru
n:
Set-ExecutionPolicy RemoteSigned
Create a file called "disable_wakejobs.ps1" that contains one line of code:
Get-ScheduledTask | ? {$_.Settings.WakeToRun -eq $true -and $_.State -ne "Di
sabled"} | % {$_.Settings.WakeToRun = $false; Set-ScheduledTask $_}
Open Task Scheduler and create a scheduled task.
In the "General" tab, set the user account to "SYSTEM" user (or you'll have
to update a saved password every time you change your own password.)
In the "Triggers" tab, create a trigger that runs the job daily and repeat e
very hour.
In the "Actions" tab, create an action to "Start a program", with "Program/s
cript" set to "PowerShell.exe", and arguments -Command "c:\tools\disable_wakejob
s.ps1" (change the path to where you stored disable_wakejobs.ps1 in step 2.)

PowerShell: Things to check if computer keeps waking up


You may find that your Windows 8 computer wakes up by itself when in sleep mode.
One reason could be a scheduled task. You can use PowerShell to list such tasks
:
Get-ScheduledTask | ? {$_.Settings.WakeToRun -eq $true -and $_.State -ne "Disabl
ed"}
And you can turn this off by running:
Get-ScheduledTask | ? {$_.Settings.WakeToRun -eq $true -and $_.State -ne "Disabl
ed"} | % {$_.Settings.WakeToRun = $false; Set-ScheduledTask $_}
Another reason why your computer may wake by itself is connected devices. You ca
n list those devices like this:
powercfg /devicequery wake_armed
And you can query if you computer was waked by a device by running:
powercfg /lastwake
To disable the wake option on a device you can run the command:
powercfg /devicedisablewake <devicename>

To do this on all devices you can combine the commands with PowerShell:
$DevList = (powercfg /devicequery wake_armed); if ($DevList -ne 'NONE'){foreach
($Dev in $DevList){If ($Dev -ne ''){(powercfg /devicedisablewake $Dev)}}}

Potrebbero piacerti anche