Computer comes out of sleep randomly

Jambe

Distinguished
Aug 11, 2011
37
0
18,530
Windows 7
If I shut down by clicking on Sleep everything is fine except randomly after a period of time, maybe minutes, maybe many hours, the computer comes out of Sleep.
The mouse is set up to bring it out of Sleep but the mouse is turned OFF when this happens.
I do have a Cisco X2000 modem/router connected by Ethernet. I did notice it came on once when I used the TV remote but that may have been a coincidence as it comes on when not using the remote.
Is there something I may have missed in Windows settings?
 
some electronics around the mouse can trigger the mouse move that waked up windows... try to disable the wake by mouse to make sure that's the issue but something similar was happening on my pc too. the laser/ir sensor on the mouse can sometime pick up interference as actual mouse movement...
 

jinksy

Honorable
Dec 16, 2012
434
1
10,860
PC waking in sleep mode: Finding the Problem

1cmd_lastwake_alternative.jpg


To quickly find out which one it is, you will need to summon your command prompt with administrative rights. To do so in Windows 7, search for “cmd” in your Windows search bar, right-click it and select “Run as Administrator”. In Windows 8, simply hold down the Windows-key + X and select the option “Command Prompt (Admin)” from the menu. In the following prompt, enter the line

powercfg - lastwake

to identify the event or device that is responsible for the last waking process. Once the results are shown, check the “Instance Path:” to see where it originated from (the USB or PCI port for instance) and look under “Type:” for the nature of the cause, typically a device or a wake timer. You can find solutions for both cases further in the solutions section of this article.

Tip: Disabling the wake-up function of one device is usually enough to prevent accidental boot-ups in the future. If you'd like to make absolutely sure that your PC stays put however, you might also want to have a look at all other devices that can potentially wake him up. To get an overview, enter

powercfg -devicequery wake_armed

into the prompt. Conversely, you can also get a complete list of all devices that can be programmed with a wake-up function by entering

powercfg -devicequery wake_programmable

into the prompt - for instance, if you'd like to find out whether or not your keyboard can be turned into a second power button. In either case, note down the names of all devices that you want to add or remove from the wake-up list and jump to the solution section further below.

cmd_wakelist.jpg


B) Via the Windows Event Viewer

If the approach with the command prompt hasn't yielded any (interpretive) results, you can also try looking for the cause in the more user-friendly Windows Event Viewer. To open it, hold down the Windows-key + R and type in “eventvwr.msc”.

Once inside, click on the little arrow next to “Windows Logs” in the left panel to expand its contents and select the entry “System”. As the number of events often rank in the thousands, this might take a little while to process. Look on the right side for an option called “Filter Current Log” to filter them according to certain criteria. Look for the drop-down menu “Event sources” and select the entry “Power-Troubleshooter” from its long list of options and click on “OK”.

eventviewer.jpg


This will give us a compact overview of all recent wake up events with both date and time in the middle of the Event Viewer. Simply check all the suspicious ones for the “Wake Source” to see what caused the disturbance.

Also take a look at: How to shut down Windows 8 with your computer's power button

2. PC waking in sleep mode: Solving the Problem
A) If a device is the cause

If your wake source is listed as a device, the problem typically lies with your mouse or keyboard, though network cards are also infamously known to cause inexplicable wake-ups. In either case, head into your device manager by holding down the Windows-key + R and enter “eventvwr.msc”. In the device manager, search for the the device in question, right-click it and select “Properties”. Then simply switch to the “Power Management” tab and uncheck the box for “Allow this device to wake the computer”.

In case you want to add or remove this function from other devices as well (as described above), search for them in the device manager and (un)check their boxes in the same manner.

device_manager.jpg


Note: The same result can be achieved with the help of the trusty command line tool. Tough obviously more complex, you can give this method a shot if the box for the wake-function is grayed out in the device manager and can't be modified as a result. Make sure to start the command prompt with administrative rights and enter either

powercfg -devicedisablewake “[devicename]”

or

powercfg -deviceenablewake “[devicename]”

B) If a wake timer is the cause

If a program wants to schedule regular maintenance, it typically asks Windows to reserve a wake timer for a specific time and/or day of the week. This automatically causes your PC to wake up, download the necessary files and apply the updates. While this could be considered a useful function in theory, more often than not, Windows neglects to shut itself down again after the process has finished, thus staying up all night and wasting precious energy.

To get an overview over all active wake timers, pop up your command line tool again (with administrative rights), and enter the line

powercfg -waketimers

waketimercmd.jpg


If the name of the program that is causing the disturbance can be clearly discerned from the results, its usually enough to open it up and modify or deactivate the updating routines manually. If not, or if there are simply too many wake timers active to bother with them individually, you can just deactivate them altogether.

To do so, hold down the Windows-key + R and enter “powercfg.cpl” to bring up the “Power Options” of Windows. Click on “Change plan settings”, followed by “Change advanced power settings” in the next section to open the “Advanced settings” window. Expand the entry called “Sleep” as well as its submenu “Allow wake timers”. Depending on whether you are using a laptop or a PC, you will likely see either two or just one option at this point. In any case, just set them to “Disable” and troubling wake timers should be a thing of the past.

waketimeroptions.jpg
 

Jambe

Distinguished
Aug 11, 2011
37
0
18,530
WOW!
I haven't worked my way through all of the above yet--will have to have another unintended wake up since Shut down clears the list.

Using the information Jinksy provided I was able to use powercfg /lastwake to get this information:
Type: Wake Timer
Owner: [Process] \device\HarddiskVolume2\windows system32\services.exe
…Reason: Windows will execute `Microsoft\Windows\Media Center\mcupdate_scheduled' scheduled task that requested waking the computer.
———

If I go to Task Scheduler I see there are 45 Active Tasks! First one is Google Updater…. If I double-click it, under System there are radio buttons which say "Run only when the user is logged on" and "Run whether the user is logged on or not" The latter is checked and I can find no way choose the former. (They are grayed out as are 90% of the buttons on other tasks.)

Only one mentions Media Center and it is triggered only at start up, so maybe something else started the computer and this is listed in the lastwake info above since it is triggered at start up.

I'll continue this later....
 

Jambe

Distinguished
Aug 11, 2011
37
0
18,530
@jinksy

That link to Microsoft's knowledge base was very helpful. I manually changed the Media Center updater and will track it to see if that has taken care of the problem. I haven't looked at changing any of the other 44 tasks--just one at a time, but I suspect I will be able to change others as well.

Again, very helpful information.
 
@jinksy -- WOW

@Jambe. Check also for 'wake on lan' or "Wake on Magic Packet" some similar name in your BIOS setting. If that is on and you get certain types of network traffic it will wake up your PC. http://windows.microsoft.com/en-us/windows7/what-are-wake-on-lan-capabilities. Enabled by default on a desktop.

opps, missed this. never mind. "Using the information Jinksy provided I was able to use powercfg /lastwake to get this information:
Type: Wake Timer
Owner: [Process] \device\HarddiskVolume2\windows system32\services.exe
…Reason: Windows will execute `Microsoft\Windows\Media Center\mcupdate_scheduled' scheduled task that requested waking the computer.
———"