Well, I have not really had a lot of time to investigate this. This problem sort of comes and goes, and I don't have all the time in the world to sit by the computer and wait for it to misbehave. But at least in my case, this appears to be related to the internal workings of Windows 8 and its different scheduled tasks and triggers.
You can see from the screenshot above that the automatic maintenance last ran on 2015-09-13 at 00:57 hours. Despite the fact that automatic maintenance is disallowed according to the settings, as seen in Action Center.
Note that the option "allow scheduled maintenance to wake up my computer at the scheduled time" is checked.
Windows automatically runs scheduled maintenance on a daily schedule
when you're not using your computer.
This includes tasks such as software updates, security scanning, and
system diagnostics. This maintenance will run daily if you aren't
using your computer at the time you've chosen. If your computer is in
use at the scheduled time or maintenance is behind schedule, Automatic
Maintenance will run the next time the computer is not being used.
Pay attention to the last sentence in that text. What they left out is that it will wake the computer if necessary. "Automatic Maintenance will run the next time the computer is not being used [and wake it if necessary]."
I am often late with installing Windows updates, and I install them manually. This is because I need my computer for work, and I prefer to review the updates before they are installed. I therefore prefer to install them at my own pace and when I have time. I simply like to be in control of my own computer. Not some wise guy from Microsoft telling me how to run my system. But because my update installs are often overdue, the Windows 8 is apparently configured to kick in some of these scheduled tasks, and even wake the computer if necessary and install the updates for you, and successfully install the updates by overriding your user preference not to install updates automatically.
They have stepped this up now in Windows 10 to the point where you as a user don't even have the choice to review and install updates manually. Go figure... your computer is remotely controlled and dictated to from Redmond. Nice!
In the screenshot above, you can see that the wake timers have been disabled.
I actually use WOL (wake on lan) and I can't have it disabled. I don't want to! I choose not to! But this should not affect the problem that's being described. If there was any unexpected wakes due to network devices waking the computer by sending some gibberish packets on the network, this should be remedied by enabling WOL only for magic packets (as suggested in other answers here).
But the reason the computer is still being waken up is highly likely because of the way Windows 8 is configured to trigger scheduled tasks that wake the computer. In my case, these appear to be caused by overdue Windows update installs.
You can see in the screenshot above that the Regular Maintenance task last ran on 2015-09-13 at 00:57 hours. That's the same date and time as seen in Action Center.
I believe this is what's causing the infamous Wake Source: Unknown string to be printed for the powercfg -lastwake
command. If you want to try to prevent the computer from waking up unexpectedly (and gain back some control of your computer) I would suggest disabling all of these scheduled tasks:
\Microsoft\Windows\TaskScheduler:
- Idle Maintenance
- Maintenance Configurator
- Manual Maintenance
- Regular Maintenance
\Microsoft\Windows\WindowsUpdate:
- AUFirmwareInstall
- AUScheduledInstall
- AUSessionConnect
- Scheduled Start
- Scheduled Start With Network
You will find these by running taskschd.msc from the run prompt and navigating to their location.
Update: still wakes up
I just had my computer wake me up and disturb my sleep, because it can't sleep, or it won't sleep. This thing is out of control! It's sick! It's alive! I will have to hospitalize it or myself.
C:\Windows\system32>powercfg -lastwake
Wake History Count - 1
Wake History [0]
Wake Source Count - 0
As usual... useless! But the next command pointed out a possible culprit.
C:\Windows\system32>powercfg -waketimers
Timer set by [PROCESS] \Device\HarddiskVolume1\Users\Sammy\AppData\Roaming\Spoti
fy\Spotify.exe expires at 02:00:50 on 2015-09-20.
Reason: generic
I did have Spotify running in the foreground. Once I exited Spotify, the wake timer disappeared.
C:\Windows\system32>powercfg -waketimers
There are no active wake timers in the system.
Go figure! But I should mention that I am overdue with Windows Update... updates. Again! But also worth mentioning, is that I have disabled WOL for the NIC a few days ago, and I have rebooted since (so those settings should be applied). So this clearly shows that WOL is not the culprit... at least not in this case. (Unless those little check boxes in Device Manager are broken, and are indicating a disabled feature but clicking on them is not changing anything in the system.)
I don't have the time and energy to investigate this further, especially not at this hour. I need my sleep. So does the computer... but some corporate jerks across the ocean seem to think otherwise so they had the system programmed to disobey my commands. Well.. I guess I will have to start pulling the plug! Hah! I would like to see them beat that old-fashioned trick. Remove the power and it should not wake up.
When it woke up, did it go back to sleep again? Or just stay powered on until you send it to sleep again manually? I'm thinking that if it's programmed to wake up to get updates from Windows Update, I would expect it to go back to sleep when it's done. – Samir – 2014-09-14T09:53:29.543
3Wake on network activity, perhaps? I've also owned more than one laptop that woke itself up for seemingly no reason at all - when the lid was closed and inside a laptop bag – agent86 – 2012-10-27T21:22:04.540
Yup, same for me. In my case, a 3G card that kept trying to dial out. Whenever I put the laptop to sleep, I'd power off all the radios first. – None – 2012-10-27T21:23:15.973
It might be my laptop or NAS, but how can I figure out what might be causing it? – Ivo Flipse – 2012-10-27T21:23:25.693
I'm not in front of my Win8 box at the moment, but does the event log have any details about what triggered the power state change? – Nathan Osman – 2012-10-27T21:30:24.687
I guess its easier to find that out next time it happens, unless there's an easy way to find the event – Ivo Flipse – 2012-10-27T21:34:10.737
I swear I read somewhere that in Windows 8 when you put a computer to sleep it will automatically wake up after three hours in order to shut down completely; since the computer doesn't do that it means the problem is in this final power transition. I can't find anything however to back this up however. – badp – 2012-10-27T21:53:54.450
Run the command and check
powercfg -devicequery wake_armed
and check which device is causing the system to wake up. Then you can disable it under the device manager by right click on device and select properties under the power management tab. – avirk – 2012-11-02T02:22:15.9633Check out your Power Management Options on your
Control Panel> Power Settings>Change plan settings>Change advanced power settings
. -> “Multimedia settings” option, “When sharing media.” ->”Allow the computer to sleep. Check other options one by one while you’re at it. – avirk – 2012-11-02T02:48:13.313http://technet.microsoft.com/en-us/library/cc748940(WS.10).aspx. – avirk – 2012-11-02T02:49:32.033