SOLVED: Computer Goes Back To Sleep After Wake Up

This post will show you how to prevent your computer from falling asleep too soon.

PROBLEM: COMPUTER FALLING ASLEEP TOO SOON AFTER WAKE UP


PROBLEM: COMPUTER GOES BACK TO SLEEP SOON AFTER WAKE UP


PROBLEM: COMPUTER FALLING ASLEEP TOO SOON AFTER WAKE UP

I've been telling you how I resolved the problem of Windows Vista not waking up from sleep or hibernate. Now that this problem is solved, I encountered another one: Laptop computer goes back to sleep soon after wake up or resume.

This only happens when I don't touch the keyboard after the computer is back up. It is annoying because resume from hibernate takes quite a while, maybe 2 minutes. I leave to get something else done while waiting. I come back and find computer has fallen back to sleep/hibernate again. I lost 5-10 minutes that way.

Others schedule their computer to awake at a certain time for a scheduled task. Their annoyance is that the computer goes back to sleep before the task is completed. I will show here how both problems are resolved. The same solution applies to both.

SOLUTION

It turns out (credit for reporting this goes to http://vista64.com) that Vista will fall back asleep or hibernate after a specified amount of time if not physically interacted with. Such as by typing or moving the mouse. This amount of time is set to 120 seconds or two minutes. The value is stored in registry.

If you are uncomfortable changing registry, please ask someone else or just keep in mind you need to be there within 2 minutes of Vista computer waking up and need to touch the keyboard.

HOW TO CHANGE THE TIME BEFORE COMPUTER FALLS ASLEEP

Here's how to change the appropriate key in the Registry: Click Start, then in the box on the bottom type regedit. If prompted by UAC, click Continue.

Registry editor comes up. Follow the tree: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues

In the left pane, click on the triangle to expand DefaultPowerSchemeValues into three subvalues. They correspond to Balanced, High Performance, and Power Saver options. To be safe, just change all three values, under both AC and DC values. So total of six. I changed from the default 120 seconds to 300 seconds. So long as I'm back in 5 minutes the computer won't fall back to sleep or hibernate.

If a scheduled program is waking computer up from sleep, make sure you set the value to longer than the maximum anticipated duration of the run of the scheduled program.

THIS SOLVED MY PROBLEM. WHAT ABOUT YOU?

Have you found this solution workable, and useful? Are you now able to get back to your computer before it falls back into hibernate? Or, are the programs that are waking up your computer getting enough wake-up time to complete their jobs? Let me know either way, ok? Just click on the "Leave a Comment" link below!

11 comments:

Anonymous said...

i have this problem under XP and this did not work because the registry entries do not match. If anyone has an XP solution, please post.

Anonymous said...

A possible solution is to run your programs from a script or batch file and add the following:

c:\windows\system32\powercfg.exe -setactive GUID

To get the GUID do "powercfg /L" from a command prompt. You are looking for whatever your default power profile is and the one for high performance. Put the command at the beginning of the batch file to switch to high performance power profile and once again at the end to switch back to your regular power saving profile (use appropriate GUID each time). I think XP has the same command but does it by name not GUID - you'd want to use the always on profile for XP.

Please note that I haven't tested this yet, but there's no reason it shouldn't work. I run Areca backup to backup my files to adrive.com and have had backups mess up alot because of the machine going to sleep. I just thought of the profile switching via command line as a possible solution tonight so I'll post back here with my results in a few hours. :)

Anonymous said...

The powercfg thing worked but the backup failed towards the end. The problem was unrelated to powercfg and was a ftp communication issue.

Disclosure said...

Anonymous 2 & 3, Thanks for helping Anoymous 1 with the XP situation, and keep us all posted! Thanks for your contribution! Great to have a solution for Windows XP!

Anonymous said...

Thank you so very mutch.

Just so everyone knows to type in the number make sure you use the decimal option otherwise it will be different.

Disclosure said...

Anonymous, thanks for your update. Did the GUID trick work for you ? Did you have a chance to try it out?

Anonymous said...

excuse me , I didn't understand how to solve "2 minutes problem" in win XP ! would you explain it in detail ?

thanks

Disclosure said...

Hi Anonymous, what problem are you referring to exactly? Please provide more details about your situation so we can help.

The above solution is explained in great detail, if you have trouble understanding, provide last sentence that you still understand. Also, give the first sentence which do do not understand anymore.

Anonymous said...

Hi , I didn't understand these sentences :
"A possible solution is to run your programs from a script or batch file and add the following:
c:\windows\system32\powercfg.exe -setactive GUID
To get the GUID do "powercfg /L" from a command prompt. "

what should i do in win xp registry ?

Disclosure said...

Anonymous, as the first commenter suggested, the Registry entries are different in XP.

If you find the equivalent entries in XP, let us know.

The script or batch file solution suggested by another Anonymous has nothing to do with the registry though.

ZigBe said...

The problem is XP goes into hibernation 5 minutes after being started up or woken up if there is no real keyboard or mouse activity.

What DOES work is changing the power profile of the computer (I don't know why, it just does). First find out the list of all possible power profiles with this dos command entered at the C:> prompt in a dos box:
powercfg /L
Then find out what profile you are currently set to with:
powercfg /Q
Your current profile name will be on the first line.

Then create a batch file called hibernate.bat with the following lines:

c:\windows\system32\rundll32.exe powrprof.dll,SetSuspendState Hibernate
powercfg /s "Presentation"
powercfg /s "Always On"

The second powercfg line should contain your current profile name in quotes.
The first powercfg line should contain ANY other valid profile name.

Double click this batch file to start hibernation. The first line puts the computer into hibernation. When it wakes up the next two lines will run changing the power profile to "presentation" and then back to "Always On". Just the act of switching to one profile and then back to your usual profile will be enough for windows XP to not automatically go into hibernation 5 minutes after starting up.

This won't work if your computer enters hibernation on it's own, but it does work for a user initiated hibernation via the .bat file.

You can also create a second batch file with just the last two lines in it:
powercfg /s "Presentation"
powercfg /s "Always On"

Call it SwitchPower.bat and put it in you Start Up folder. The you have also solved the problem of the computer shutting down after a restart or cold boot, too.

Post a Comment