Why is my computer automatically leaving sleep mode after few seconds?

I recently faced a problem with my computer, every time I was setting it in sleep mode it was waking up automatically after few seconds. As I had no explanation at the first sight, I started to dig and I learn few things.

Why is my computer automatically leaving sleep mode after few seconds?

I recently faced a problem with my computer, every time I was setting it in sleep mode it was waking up automatically after few seconds. As I had no explanation at the first sight, I started to dig and I learn few things.

First of all, Windows provides the ability to schedule timers to wake your computer. I never used that but just to clear this cause, you can run the following command in your Command Prompt (Win + R > cmd > Enter)

powercfg /waketimers

It confirms to me there is nothing configured! Next!

The following command shows which devices are authorized to wake up your computer, like your mouse or keyboard for example. We are all used to hit one of them to wake the computer, right?

powercfg /devicequery wake_armed

As my network adapter is part of that list, I was thinking about a Wake-On-Lan behavior triggered from another device on the network but as it's part of a bigger list, I wanted to be sure and finally found the perfect command for this.

This command provides information about the last timer or device which woke up your computer. To make it efficient, put your computer in sleep mode, wait for the undesired wake up to happen and then run the command.

powercfg /lastwake

It confirms the theory! A device on my network obviously doesn't want my computer to sleep quietly!

Now I need to turn that off and there is two options for that:

  1. Chase the signal and shut it down
  2. Configure my computer to not take care of that signal

As I really don't want any device to be able to wake up my computer, I have looked at the second option first, to kill the problem and it's pretty easy to do.

  1. Hit Win + R > type devmgmt.msc > Enter
  2. Identity the network adapter found with the command above
  3. Right-click > Properties
  4. Open "Power Management" tab
  5. Uncheck "Allow this device to wake the computer"
  6. Click OK and quit

Now my computer can finally sleep quietly (and so do I) without any savage packages waking it up!

Now I'm still wondering what was causing this issue. I have tried some Wake On LAN package sniffers like Wake On LAN Monitor but so far I didn't find anything.
May be because the packages are only sent when my computer is off?

If you have any suggestion, hit the comment section!

Looking for help?
If you are looking for some help or want a quick chat, please head over to the Discord Community!