How-To Geek

How to Prevent Your Computer From Waking Up Accidentally

wpw_top

Putting your PC to sleep is a great way to save energy while still making sure you can resume work quickly. But what can you do if your PC keeps waking up on its own? Here’s how to figure out what’s waking it up, and how to prevent it.

When you put your PC to sleep, it enters a power-saving state where it shuts down power to most of the PC’s components, keeping just enough power trickling to keep the memory refreshed. This lets you quickly wake the computer back up to the same state it was in when it went to sleep—including any documents and folders you had open. One of the differences between sleep and hibernation is that when a PC is alseep, activity from certain devices can wake it up. Scheduled tasks can also be configured to wake the PC up so that they can run.

How to Find Out What’s Waking Your PC Up

Before you can fix the problem, you need to determine the problem. There are a few different steps you’ll probably need to take here, as no one solution fits everyone.

See the Last Thing That Woke Your PC

The first step in figuring out why your PC is waking up before you want it to is determining what’s doing the waking. You can usually figure out what event caused your computer to wake up most recently with a simple Command Prompt command. Start the Command Prompt by hitting Start, typing “command,” and then selecting the “Command Prompt” app.

wpw_1

In the Command Prompt window, type the following command and press Enter:

powercfg -lastwake

wpw_2

I can tell from the output of the command above, for example, that I used the power button to wake my PC. You may also see listed devices—like your mouse, keyboard, or network adapter—or events like wake timers or automatic maintenance.

This won’t always give you the information you need, but often it will.

Explore Other Wake Up Events with Event Viewer

While the Command Prompt command we just talked about is great for showing you what last woke your PC, sometimes you need to go a bit further back in history to see what’s woken it up before. For that, we’ll turn to Event Viewer, a handy logging tool that will help us see when your computer turned off (be that because it was shut down, put to sleep, or hibernated) and when it woke up.

To open Event Viewer, hit Start, type “event,” and then select “Event Viewer.”

wpw_3

In the left-hand pane, drill down to Event Viewer (Local) > Windows Logs > System. You’ll see a lot of information here, but don’t worry. You don’t need to read through or attempt to understand everything going on in the log. We’re going to filter it to just the stuff we need to look at. Right-click the “System” log and choose “Filter Current Log.”

wpw_4

In the Filter Current Log window, on the “Event sources” drop-down menu, select the “Power-Troubleshooter” option and then click “OK.”

wpw_5

Back in the main Event Viewer window, you’ll see that we’ve filtered out the hundreds of messages that aren’t relevant to our problem and honed right in on the thing we care about: when the computer is waking up from a low-power state. In the new filtered view, you can scroll through every instance where your computer has woken over the duration of the log (which should be hundreds of entries).

wpw_6

What you should focus on is the time the event was logged (did it wake at a time you were at the computer or was it a random middle-of-the-night wake up call) and what Wake Source is indicated.

  • If the Wake Source says “Power Button,” that indicates that the power button on the PC was pressed to wake it up—an action you most likely took yourself.
  • If the Wake Source says something like “Device–HID-Compliant Mouse (or Keyboard),” that indicates the PC is configured for key presses and mouse movements to wake it.
  • If the Wake Source lists your network adapter, that indicates your PC is configured so that incoming network activity can wake it up—something that’s useful if you like having your PC go to sleep but still need it available to other network devices at times.
  • If the Wake Source says “Timer,” it means that a scheduled task woke the computer. The source information usually includes some indication about the task that woke the PC. For example, in the previous screenshot, I can tell that my PC was woken up in order to do a scheduled restart after an update.
  • You may also see something like “Wake Source: Unknown,” which is a bit more cryptic but at least it tells when the PC was awoken.

Once you’ve established that there is in fact a pattern of odd computer wake up calls and you’ve identified the source, it’s time to do something about it.

How to Stop Your PC From Waking Up Randomly

Hopefully, one of the above tricks helped you figure out what’s waking your PC. Now, it’s time to solve the problem. Skip down to the section that applies to your situation.

Limit Hardware Devices That Can Wake Your PC

As you probably noticed from looking through Event Viewer logs, there are four primary hardware devices that can wake your PC: mice, keyboards, network adapters, and power buttons (or laptop lids if that’s what you’re using). You can easily view a complete list of the hardware devices allowed to wake your PC with a Command Prompt command. Open up a Command Prompt window and run the following command:

powercfg -devicequery wake_armed

wpw_7

In this example, I’ve got several devices that are allowed to wake my PC, including an Intel Ethernet adapter, two keyboards (I switch between regular and gaming keyboards), and a mouse. Whatever your setup, now that you know what devices can wake your PC, you can head over to Device Manager to tell them not to.

We’ve covered in detail how to prevent your mouse from waking your PC and how to prevent network activity from waking your PC. So, in our example here, we’ll be preventing the keyboard from waking the PC. Why would you want to do this? One word: cats.

(This should, however, work for other devices that may be waking your computer—not just keyboards.)

Open Device manager by pressing the Windows key, typing “Device Manager,” and then pressing Enter.

wpw_8

In the Device Manager window, locate the device you want to prevent from waking your computer. It will have the same name as it does in the output of the powercfg command you just ran. Right-click the device and select “Properties” from the context menu.

wpw_a

On the “Power Management” tab of the device’s properties window, disable the “Allow this device to wake the computer” option and then click “OK.”

wpw_b

While you’ve got Device Manager open, go ahead and disallow any other devices you don’t want waking up your computer. When you’re done, you can exit Device Manager.

Disable Wake Timers and Scheduled Tasks

The other thing that can wake your PC is a scheduled task. Some scheduled tasks—for example, an antivirus app that schedules a scan—can set a wake timer to wake your PC at specific time to run an app or command. To see a list of wake timers set on your computer, you can use a Command Prompt command. You’ll have to run Command Prompt with administrative privileges for this one. To do so, hit Start, type “command,” and when you see the Command Prompt app, right-click it and choose “Run as administrator.”

wpw_11

In the Command Prompt window, type the following command and then press Enter:

powercfg -waketimers

wpw_12

In this example, you can see I have one wake timer—a scheduled task set to check whether I have any large files queued for downloading so that I can have the downloading happen when I’m not using the PC.

You have to choices for stopping this: you can disable that specific wake timer, or disable all wake timers.

If you just want to stop one task from waking your computer, you can uninstall the app that created the task or adjust the scheduled task settings. You can read the full instructions for working with scheduled tasks in our article on automatically running programs with the Windows Task Scheduler, but here’s the short version.

Find the task in Task Scheduler, right-click it, and then choose “Properties”. In the Properties window, on the “Conditions” tab, turn off the “Wake the computer to run this task” option.

wpw_13

This leaves the scheduled task in place and, if your PC is awake, Windows will run the task. It just won’t wake the PC in order to do it.

If you don’t want any programs waking your computer up automatically, you can disable wake timers entirely. To do so open the Power Options Control Panel app it by hitting Start, typing “power options,” and then pressing Enter.

wpw_14

In the Power Options window, click the “Change plan settings” link next to the plan you use.

wpw_15

In the next window, click the “Change advanced power settings” link.

wpw_16

Expand the “Sleep” entry, expand the “Allow wake timers” entry below it, and then set the entries below it to “Disabled.” If you’re on a laptop, you’ll see two entries—“On battery” and “Plugged in”—and you can configure these for different settings if you want. If you’re using a desktop PC, you’ll only see one setting under the “Allow wake timers” entry, as in this example.

wpw_17

Note that if you’re using Windows 10, you’ll also have a third option other than just enabling or disabling the wake timer. This option is called “Important Wake Timers Only” and wakes your PC only for major Windows system events like a scheduled restart of your PC outside active hours following a Windows update. You can try setting your wake timers to “Important Wake Timers Only” and see if it solves your problems. If your PC is still waking up more often than you’d like, you can always come back and set wake timers to “Disabled” instead.

Prevent Automatic Maintenance From Waking Your PC

By default, Windows runs automatic maintenance tasks at 2:00 am every night if you’re not using your computer. It’s also set to wake your PC from sleep to run those tasks. These tasks include things like checking to see if your hard drive needs defragmenting, running system diagnostics, checking for disk volume errors, and more. They are important tasks to have run periodically, but if  you’d prefer that Windows not wake your PC to do it, you can turn that setting off. We’re using Windows 10 as our example here, but you’ll find the settings in the same place in Windows 8 and 7.

In Control Panel, switch to icon view and then open the Security and Maintenance app.

wpw_w

On the Security and Maintenance page, expand the “Maintenance” section and then click “Change maintenance settings.”

wpw_x

On the Automatic Maintenance page, turn off the “Allow scheduled maintenance to wake up my computer at the scheduled time” option. Of course, you can also set the schedule time to something you like better if you want.

wpw_y

If you do turn off Windows’ ability to wake your PC to run maintenance tasks, you should still let it run those maintenance tasks occasionally. You can do that by setting the scheduled time to when you’re more likely to have your PC turned on or you can do it manually by clicking “Start maintenance” back on the main Security and Maintenance page.

wpw_z


Sleep is a valuable tool for preserving energy while still keeping your PC immediately available when you need it. While you’ll likely want some devices (like your keyboard) and some scheduled tasks to be able to wake up your PC, it’s good to know that you have some tools for investigating why it’s waking up and options for stopping it from happening when you don’t want it to.

Walter Glenn is a long time computer geek and tech writer. Though he's mostly a Windows and gadget guy, he has a fondness for anything tech. You can follow him on Facebook and Twitter.

  • Published 11/7/16
  • Steve Kohn

    Long a lurker at HTG, I'm moved to register just to express admiration for such a well written article. Many thanks to HTG and the author.

  • Yu0

    Great summary!

    Just really, it is kind of sad, that this is even necessary. Laptops should really disable all wake-events other than opening the lid and pressing the power button when they are not connected to the power grid.

    When sleeping on battery, chances are that the battery time will be needed and that the laptop is inside a bag or other storage, where waking risks heat-damage to either the device or its environment.

    Hence wake-on-battery should be whitelist-based, rather than having to track down the origin of unwanted wake-events. If needed for centralized maintenance in a company, it could still be changed by group-policies.

  • Christian M.

    off-topic, but that cover picture made me laugh a good time!

  • Rocky Rodenbach

    My computer would wake up during the night sometimes, and I figured out through observation it was Windows update that was causing it to come on. It wouldn't initiate, but just wake the computer from sleep mode. Unchecking "Allow this device to wake up the computer" is also helpful especially things like network cards.

  • Rob B

    Excellent article!My power settings should prevent wake timers while on battery, but it does not appear to be working. Using powercfg, it appears that svchost.exe woke the system to run 'Maintenance Activator' last night, waking my laptop (Dell XPS13 running Windows 10) about every 15 minutes and draining the battery in the process. I don't know if that relates to Windows update or McAfee. My guess is that it is related to Windows update, but most of the wake options are greyed out in Task Scheduler. Any suggestions for a fix?

  • Walter Glenn

    @Rob_B: Thanks!

    I do have a suggestion for you. Windows does automatically run maintenance tasks daily when you're not using your PC. If you would prefer that these tasks not wake your computer, you can make that happen.

    In Control Panel (category view), go to Security and Maintenance. Expand the Maintenance section and click "Change maintenance settings." Here, you can choose the time maintenance tasks run and also turn off the option to wake your PC to run them.

    I should probably add that to the article :slight_smile:

    UPDATE: I did add it toward the end of the article if you want better guidance with screenshots!

  • Yu0

    Had the issue today again.

    In the evening, I closed the laptop, sending it to standby. In the morning I put it into the bag.

    Halfway in the tram I had to open the bag, because it was smelling of burnt dust. Thankfully it didn't actually damage anything though.

    Really, I see no good reason to allow a laptop to wake from sleep by default when not connected to a power-supply. At best it wastes battery when needed otherwise, at worst it is a fire hazard.

  • Yu0

    By any chance, do you use Google Chrome?

    I noticed that something sleep is prevented entirely, until Chrome is closed. The device will go to sleep, but will wake up right away.

  • Keith R. Starkey

    Great, great, article. Since of of those major updates for Win 10, I've had problems left and right trying to get my system to both sleep/hibernate and then stay that way. This article will help a lot. Thanks!

  • Sean Ivo

    Regardless of how your computer wakes up, there are programs out there that can ensure it goes back to sleep. One example is MollieSoft WinSleep, which uses cpu/disk/network usages to put it to sleep when it is under-utilized, on a time schedule.

  • Leo

    Great article and have tried everything you have suggested but still having the following problem:

    When I shutdown my PC (full shutdown), my Logitech wireless devices (have their own usb wireless plugin) can turn it back on again. It's annoying as even just moving the mouse turns it back on. It hasn't been registering it as a wake-up on event viewer.

    Is there anything you can suggest to stop this from happening? Is there a way of turning off USB power on shutdown so that it cannot receive the signal?

More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!