Sign in to follow this  
Followers 0
swi

Win7 hibernate resume

4 posts in this topic

Win7 uses a different API than XP and Vista so I am having trouble creating a script to automate a resume from hibernate or standby. I have seen this thread: http://www.autoitscript.com/forum/index.php?showtopic=21575 and have been able to use this code in order to resume on XP but cannot get it to work with Win7. Any help is appreciated.

Share this post


Link to post
Share on other sites



The windows API are mostly backwards compatible so I'm guessing the code should work...

However I believe there have been some problems with the windows 7 sleep/hibernate feature... for example-

http://gizmodo.com/5133399/win-7-tip-sleep...te-your-machine

http://www.windows7taskforce.com/view/979

http://mydellmini.com/forum/vista/794-wind...oesnt-work.html

http://social.technet.microsoft.com/Forums...19-85a9db02b0b6

Which may have some contribution to your problem...

What exactly does the code do when you run it? any errors or does literally nothing happen?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

It hibernates but will not resume. However there are no problems if I try to hibernate/resume manually. This is why I think it has something to do with the API.

I noticed Win7 uses new API: SetWaitableTimerEx (http://msdn.microsoft.com/en-us/library/dd405521(VS.85).aspx) and CreateWaitableTimerEx. The previous SetWaitableTimer has 'BOOL fResume' parameter that can be set to TRUE to resume the machine. However, SetWaitableTimerEx removes this fResume parameter and replace it with WakeContext. Iam not really sure how to use this new parameter to resume the system. Any idea?

Edited by swi

Share this post


Link to post
Share on other sites

It turns out that the script I linked to in the fist post using windows API does work. As eviltoaster said the API is backwards compatible. But there is a new Advanced Power Option in Win7 under the 'Sleep' category called 'Allow Wake Timers'. By default it is set to 'disable', which is what caused the script to fail. This option does not exist on Vista or XP.

Now I just have to find some way to change this option through automation. My intention is to have this autmation run on various computers with unknown configurations. Powercfg is not yet able to modify this setting as far as I'm aware, so I was going to export a working powerplan and then import it onto computers when the script is run.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0