II. The Method: Windows Task Scheduler. To automatically put the machine into standby or hibernate at a programmed time, I simply create a task to run a shortcut with the following target:
C:\WINDOWS\system32\rundll32.exe powrprof.dll,SetSuspendState 1 1 0 .
To automatically wake the computer I simply create another scheduled task to run whichever program or file I wish, program the time and check the box next to "Wake the computer to run this task."
III. The Problem: Computer will not wake up at the programmed time even when the check is marked next to that self explanatory phrase: "Wake the computer to run this task" and regardless of the machine being in standby or hibernate.
IV. Observations: The computer does wake up at the programmed time only when I manually put the machine into standby or hibernate. This leads me to believe that there must be something wrong with the way in which I programmed the computer to automatically standby.
There are several variations to the "SetSuspendState" on the internet:
rundll32.exe powrprof.dll,SetSuspendState Standby
rundll32.exe powrprof.dll,SetSuspendState Hibernate
rundll32.exe powrprof.dll,SetSuspendState 0,1,0 and various combinations of this last one where the three digits are supposed to be parameters involving, but not limited to, wake events (disable/enable).
I tried every combination I could find. I still have not found the one that will allow the computer to wake up.
V. Current Solution: Although it does seem to work, it involves sending keystrokes via the free program AutoIT . The script is simple:
Send("#d")
Sleep(3000)
Send("{LWIN}")
Sleep(2000)
Send("{U}")
Sleep(1000)
Send("{S 2}")
"Send" of course are the keystrokes: the first is to display the desktop, second is to call up the start menu, third is to call up the shut down screen and the last is to select standby. "Sleep" is just to allow time between the keystrokes (in milliseconds).
This to me seems like a rather sloppy solution. There must be a simple command or variation to the SetSuspendState command that will enable the Windows XP computer to wake after being set to standby using the task scheduler.
I invite anyone who happens to stumble upon this post to reply with any solutions you may have.
Thank You !
No comments:
Post a Comment