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.

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

powercfg -lastwake

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.”

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.”

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

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).

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

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.

(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.

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.

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.”

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.”

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

powercfg -waketimers

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.

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.

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

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

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.

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.

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

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.

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.

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 GlennWalter Glenn is the Editorial Director for How-To Geek and its sister sites. He has more than 30 years of experience in the computer industry and over 20 years as a technical writer and editor. He's written hundreds of articles for How-To Geek and edited thousands. He's authored or co-authored over 30 computer-related books in more than a dozen languages for publishers like Microsoft Press, O'Reilly, and Osborne/McGraw-Hill. He's also written hundreds of white papers, articles, user manuals, and courseware over the years.Read Full Bio »