Completely fix wake problems on Windows

profile.png
leo
wrote on August 28, 2015

*Updated on November 12, 2018

A well-known feature of Windows 10 and its predecessors (XP, Vista, 7, 8, 8.1) is the wake timer, which when triggered, is responsible for waking your Windows PC up from either Sleep/Hibernate in order to perform scheduled tasks for system security and stability (e.g. System Maintenance, Windows Updates, Windows Defender Scanning).

While this feature might be useful for the average Windows user, it might not be so great for the bit more tech-savvy users who might actually want Windows to remain in Sleep or Hibernate without automatically waking to perform tasks.

The Solution?

Part 1: Disable the most common Wake Timers

1. Power Wake Timers

Disable Wake Timers in Power Settings.

  1. Right-click on Start and select Run. Type powercfg.cpl and press Enter:

  2. In Control Panel's Power Options, to the right of the bold power plan, click Change plan settings:

  3. In 'Edit Plan Settings', click Change advanced power settings:

  4. In Power Options Window, Expand Sleep option, Expand Allow wake timers, and change the Setting option to Disable:

  5. Finally, click OK to save changes to the power settings:

  6. Repeat the above Steps 2 to 5 for each available Power Plan (e.g. High Performance, Power saver) if you use them:

2. System Maintenance and Windows Update Wake timers

Disable System Maintenance and Windows Update Wake timers.

  1. Right-click on Start and select Command Prompt (Admin):

  2. In Command Prompt (Admin), type powercfg -waketimers and press Enter. This lists all currently set wake timers.

  3. If the message lists a Wake Timer called Maintenance Activator, you will have to disable System Maintenance Wake Timer. System Maintenance is enabled by default in Windows 10, for system security and stability:

  4. If the message lists a Wake Timer called UpdateOrchestrator\Reboot, the Wake timer was created by Windows Update. Whenever Windows Updates are installed, a Windows Update Wake Timer is created to reboot your system at a scheduled time. The solution will depend on whether you prefer Automatic Windows Updates:

    • If you prefer Automatic Windows Updates (the default setting): Reboot your system, and the Wake Timer will disappear.
    • If you prefer to manually install Windows Updates, you can disable Automatic Windows Updates. From now on, whenever you manually install updates, remember to immediately reboot your system to extinguish those Wake Timers.
  5. If the message says There are no active wake timers in the system, all currently set Wake Timers have been disabled!

With the above steps, the most common Wake Timers have been disabled and your system will remain in Sleep or Hibernate without automatically waking up, at least for now.

3. Wake Surprises

But from time to time you might still get wake surprises.

This is mostly due to system updates (e.g. Windows Updates, driver updates, new hardware, applications) that create Wake Timers.

There are four categories of Wake Sources from my experience:

  • Device drivers. E.g. Razer mouse/keyboard driver creates wake timers:

  • System services. E.g. ATI graphics AdaptiveSleepService system service for power-saving:

  • Scheduled Tasks. E.g. Windows Update's Reboot Scheduled Task:

  • Applications. E.g. Spotify, VirtualBox

Now let's move on to identifying those Wake Sources causing random wakes.

Part 2: Deal with uncommon Wake Timers

Begin by tracking down that Wake Source.

This is done by checking the Event Logs of your system that give valuable information.

  1. Right-click on Start and select Event Viewer:

    Right-click on Start and select Event Viewer

  2. In Event Viewer, in the left pane, Expand Windows Logs, and Right-click on System log and click Filter Current Log:

    In Event Viewer, in the left pane, Expand Windows Logs, and Right-click on System log and click Filter Current Log

  3. In Filter Current Log, enter 1 as the Event ID to filter by and click OK:

    In Filter Current Log, enter '1' as the Event ID to filter by and click OK

  4. Click through all Information entries with Power-Troubleshooter as the Source with 1 as the Event ID. Repeat this until you find an entry you are certain was when your PC woke itself up. If your PC had just woken up, it should be the latest entry:

    If the Wake Source is a Device (E.g. Wake Source: Device - Razer Abyssus), the wake timer was due to a Device driver. Jump to Step 4.

    If the Wake Source is A Message (E.g. Wake Source: S4 Doze to Hibernate), the wake timer was due to a System service. Jump to Step 5.

    If the Wake Source is Unknown (E.g. Wake Source: Unknown), the wake timer was due to either a Scheduled Task or  Application. Jump to Step 6.

    If the Wake Source is something else, proceed from Step 4.

4. Wake Source: Device driver

Assess whether to disable wake for, or uninstall, the faulting device driver.

Most device drivers should not wake the system, but occasionally device manufacturers may introduce bugs that wake the system.

  • If the device requires vendor-proprietary drivers, continue at Step 4.1.
  • If the device doesn't require a vendor-specific driver (as in the case of a mouse/keyboard), continue at Step 4.2.
  • If you don't know whether your device requires vendor-specific drivers, simply continue at Step 4.1.

4.1. Disable wake for a device driver

  1. Right-click on Start and select Device Manager:

  2. In Device Manager, look through the item groups until you find the device with the same name as that found in the Event Log entry. Right-click on the device and click Properties:

  3. In Properties, click the Power Management tab, and uncheck the box "Allow this device to wake the computer", then click OK:

Congratulations, Wake events are now disabled for the problematic device. Remember to file for a bug report to your device manufacturer to correct the issue.

4.2. Uninstall a device driver

  1. Right-click on Start and select Device Manager:

  2. In Device Manager, look through the item groups until you find the device with the same name as that found in the Event Log entry. Right-click on the device and click Properties:

  3. In Properties, click the Driver tab, click on Uninstall, check the box delete the driver software for this device and click OK:

    NOTE: This step ensures Windows won't reinstall those problematic drivers automatically.

  4. Reconnect the device to reinstall basic drivers from Microsoft.

Congratulations, with the default driver, no Wake events should occur for this device.

5. Wake Source: System services

Disable any power-related service.

  1. Right-click on Start and select Services:

  2. Look through the services until you find a Service suspected to be related to Power-saving. Right-click on the service and select Properties. In Properties, change the Startup type to Manual, and click Stop to stop the service:

Congratulations, you have successfully stopped System services related Wake Timers.

6. Wake Source: Scheduled Tasks

Find out which Scheduled Tasks woke your system, and disable wake timers for that Task.

  1. Copy all of the following code. Now we're ready to use Windows Powershell to uncover those pesky Tasks.

    # Whether to print verbose information. 0 = normal; 1 = verbose
    $verbose = 0
    
    # Get the last wake timestamp in ISO format 24 hour clock, excluding seconds. E.g. '2016-12-16 00:49'
    $format = 'yyyy-MM-dd HH:mm'
    $powerLogs = Get-Eventlog -LogName System | Sort-Object TimeGenerated -Descending | ? { $_.EventID -eq 1 } | Select-Object -First 5
    if ($verbose) {
        Write-Host "Latest Power-Troubleshooter logs: " -ForegroundColor Cyan
        $powerLogs | Format-List | Out-String | % { Write-Host $_.Trim() }
    }
    $wake_date = ($powerLogs | Select-Object -First 1).TimeGenerated.ToString($format)
    
    Write-Host "Last wake time: $wake_date" -ForegroundColor Cyan
    Write-Host "Looking for tasks that ran on: $wake_date" -ForegroundColor Cyan
    $lastWakeTasks = Get-ScheduledTask | Get-ScheduledTaskInfo | ? { $wake_date -eq $_.LastRunTime.toString($format) }
    $lastWakeTasks
    
  2. Right-click on Start and Click Run. Type powershell and press Enter:

  3. In the Powershell window, right-click (or press ctrl+v) to paste the code and press Enter:

    This will show you a list of Scheduled Tasks that occurred within the same minute as the wake event. You should most often see only a few Tasks.

  4. Read the TaskPath and TaskName for the responsible Scheduled Task(s):

    In my case, the Scheduled Task's TaskName is Reboot and is located in folder \Microsoft\Windows\UpdateOrchestrator\.

    We're almost done, we just have to disable the wake for this Task.

  5. Right-click on Start and Click Run. Type taskschd.msc and press Enter:

  6. In Task Scheduler, in the left pane, navigate to Task Scheduler (Local)\Task Scheduler Library\<TaskPath>, and in the right pane, right-click on the entry with Name of <TaskName> and click Properties:

    For instance, in my case this would be Task Scheduler (Local)\Task Scheduler Library\Microsoft\Windows\UpdateOrchestrator, and in the right pane, right-click on Reboot and click Properties

  7. In Properties of the Task (in my case, Reboot), click the Condition tab, and under Power, uncheck the box Wake the computer to run the task, and click OK:

  8. Repeat Step 6.6 for each Task you find in Step 6.4.

Congratulations, you have successfully disabled wake for problematic Scheduled Task(s).

However, if you are still getting Wake issues, move on to Step 7.

7. Wake Source: Applications

Find out the responsible Application, by closing or restarting them.

  1. Unfortunately there's no easy way for this one. Because Event Logs don't give us any information as to which application woke the system, we have to resort to the process of Elimination.

  2. Try closing the Most Suspicious Applications.

    There are two from my experience: Spotify and VirtualBox.

    Spotify

    From my experience (Happened on 23rd November 2017, on version 1.0.68.407.g6864aaaf), Whenever Spotify has an update, but you haven't restarted it to update it, Spotify seems to set a Wake Timer that wakes the PC every minute.

    The solution is to close it, and reopen it to update it. Pressing the X button to close it might only minimize it to the Tray Area on the Toolbar (depending on settings), so make sure to close it fully. Then reopen it to update it.

    A running VirtualBox VM

    From my own usage of Virtualbox, a running Virtualbox VM instance might randomly set a Wake Timer that wakes the PC every minute.

    The solution is to Shutdown or Save state the running VirtualBox VM(s).

    I am still unsure about the cause for this one. My suspicion though is that it might be related to VirtualBox's network adapter settings, because it often happens to one of my VMs that uses an Internal Network. Yet again, it also happens on regular bridge network VMs, much more rarely though. So there might just be a bug in the interface between the VirtualBox Hypervisor and the PC's physical network card. Maybe someone has a better idea.

  3. Sleep your PC as usual.

  4. If your PC wakes up again, repeat Step 7.2 until you identify the suspicious application. After all, that was how I found out that one of them was Spotify.

Conclusion

If you have followed the guide entirely, you would have learnt a great deal about the variety of Wake Sources; who would've known it would be so complex.

The good news is that you will now be able to deal with any present wake problems and future gotcha wake surprises - all to keep your system is wake-proof.

I hope this helps you all.