Mr. H Posted May 22, 2006 Report Share Posted May 22, 2006 O.K., here's the deal:I'm running Windows 2000. I schedule a task to open a command window, and in the advanced properties set Windows to wake the computer in order to run the task. Let's call this task "Wake Up".If I put the computer into hibernation manually by going to Start->Shutdown->Hibernate->O.K., the scheduled task "Wake Up" will successfully awaken the computer.It is possible to schedule Windows 2000 to enter hibernation by executing the command "C:\WINNT\system32\rundll32.exe PowrProf.dll, SetHibernateState". However, if I do that, the machine hibernates at the correct time, but "Wake Up" will not wake up the computer at the designated time!! (it is possible to manually awaken the computer by pressing the power button, Windows restores just fine)What's going on?The only thing I can think of, is that in Scheduled tasks, you can choose which user the tasks should be run as. If I am logged in as "Mr. H", for argument's sake, is it actually the "Mr. H" user that runs the hibernate command if I go to Start->Shutdown->Hibernate->O.K.? Any other ideas? Quote Link to comment Share on other sites More sharing options...
cozofdeath Posted May 24, 2006 Report Share Posted May 24, 2006 I believe its because your only asking rundll.exe to perform that one function not to wake up also. Quote Link to comment Share on other sites More sharing options...
Mr. H Posted May 24, 2006 Author Report Share Posted May 24, 2006 I believe its because your only asking rundll.exe to perform that one function not to wake up also.I don't think you understand.I have two scheduled tasks. One that executes the command - which I quoted wrong in my first post, it is actually: - "C:\WINNT\system32\rundll32.exe PowrProf.dll, SetSuspendState", which hibernates the computer.The other is a scheduled task to launch a command window. This scheduled task has the option "wake computer to perform this task" set. If I initiate a hibernate manually, this second task will successfully wake up the computer. However, it will not wake up the computer if the hibernate is initiated with the command "C:\WINNT\system32\rundll32.exe PowrProf.dll, SetSuspendState". Obviously, there must be a difference between a manually initiated hibernate (by going Start->Shutdown->Hibernate->O.K.) and the hibernate initiated by "C:\WINNT\system32\rundll32.exe PowrProf.dll, SetSuspendState", but I have no idea what that difference is. Both methods look the same in that, in both cases, Windows brings up a dialogue that says "preparing to hibernate" and then a progress bar as RAM is copied to the HDD, and then the computer shuts off. Quote Link to comment Share on other sites More sharing options...
cozofdeath Posted May 24, 2006 Report Share Posted May 24, 2006 Ahhh, ok. Yeah I was thinking something else. I'm gonna try it on my machine now. Quote Link to comment Share on other sites More sharing options...
cozofdeath Posted May 26, 2006 Report Share Posted May 26, 2006 I have givin up, lol. I have no clue. I tried and you are right but I don't know why. I actually have more questions about it now. If anyone knows please post. Quote Link to comment Share on other sites More sharing options...
Mr. H Posted May 26, 2006 Author Report Share Posted May 26, 2006 Well, I've solved the problem, without really figuring out what was wrong. If anyone knows, please let me know.What I did was this:I got hold of the free program, "Auto Hot Keys", and wrote a script to send the following keyboard command sequence: "left windows key" (selects the start menu), "up key" (selects shut down), "return" (brings up shut down dialogue box), "h" (ensures hibernate option is selected), "return" (activates hibernation). I then compiled the script as an application, and scheduled that application to hibernate the machine. And my "wake up" scheduled task will wake up the machine in that situation. So, it's a bit of a "kludge", but it works. Quote Link to comment Share on other sites More sharing options...
cozofdeath Posted May 26, 2006 Report Share Posted May 26, 2006 I'm not a programmer so I don't know much about this stuff, but the SetSuspendedState function is supposed to take three boolean arguments.· HibernateSpecifies the state of the system. If TRUE, the system hibernates. If FALSE, the system is suspended.· ForceCriticalForced suspension. If TRUE, the function broadcasts a PBT_APMSUSPEND event to each application and driver, then immediately suspends operation. If FALSE, the function broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation.· DisableWakeEventIf TRUE, the system disables all wake events. If FALSE, any system wake events remain enabled.Rundll32 doesn't accept them like it does with others such as the ones for the control panel applets. I think don't think PowrProf.dll excepts arguments as well. When I monitored what files and registry keys were being looked at while the computer was going into hibernation in both method I got different results. Thats good you got it working another way. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.