XP Scheculed Task?

ManyBeers

Platinum Member
Aug 30, 2004
2,519
1
81
Ok here's the deal. I Hibernate my laptop every night at 11:45 pm via a ScheduledTask which runs this command: rundll32.exe powrprof.dll,SetSuspendState S4(this is the Hibernate state switch). You might ask "Why don't you just close the lid or push the power button". Well I usually go to bed around 11:00 and I like to have Winamp streaming music for a half hour or so to help me sleep. Then the computer hibernates. The task works perfectly.
Ok so that is why I use a ScheduledTask to hibernate the computer. I also use a ScheduledTask to wake the computer and me. That way when I get up the computer is ready to go. My wake the computer task justs runs a Notepad document called Reminder.txt. It is just reminder notes for me. This task is set to "use this task to wake the computer"(checkbox is checked)......this task does Not run as scheduled. Every morning to get the computer out of hibernation I have to resort to using the power button then the task runs. Why doesn't it run as scheduled? I believe this article explains why:
.........http://msdn.microsoft.com/en-us/library/aa373201.aspx.......... Is this article relevant?
Both tasks are created using my passworded Administrator account. I posed this question over a year ago on Aumha.net and one of the MVP's on the site gave me a work around by using Shutter.exe(http://www.den4b.com/screenshots.php?project=Shutter). If I use Shutter instead of rundll32.exe powrprof.dll,SetSuspendState S4 to hibernate my laptop all tasks run correctly including wakeup tasks.
In fact for the past year or so I haved used Shutter but I would like to just use Rundll32.exe instead.
In that article I linked to it clearly shows when invoking the SetSuspendState function there is a parameter that if True will
DisableWakeEvents and I believe that is what is happening here.

How do I make sure the DisableWakeEvent parameter is not set to True and at least eliminate that as the problem.



 

BD2003

Lifer
Oct 9, 1999
16,815
1
81
The issue is most likely related to using S4 hibernate instead of S3 suspend. In S4 the PC is off, and the only way to wake it up other than the power button AFAIK is WOL (Wake on lan)

Why are you using hibernate anyway? You're not saving any meaningful amount of energy compared to S3 sleep (probably using more overall from the extra time wasted booting and reloading the cache).

http://blogs.msdn.com/omars/ar...2004/05/11/129553.aspx

The only reason you'd ever want to use hibernate is if you're running off the battery. I'd say try using S3 instead of S4 and see what happens, my guess it'll work.
 

ManyBeers

Platinum Member
Aug 30, 2004
2,519
1
81
Originally posted by: BD2003
The issue is most likely related to using S4 hibernate instead of S3 suspend. In S4 the PC is off, and the only way to wake it up other than the power button AFAIK is WOL (Wake on lan)

Why are you using hibernate anyway? You're not saving any meaningful amount of energy compared to S3 sleep (probably using more overall from the extra time wasted booting and reloading the cache).

http://blogs.msdn.com/omars/ar...2004/05/11/129553.aspx

The only reason you'd ever want to use hibernate is if you're running off the battery. I'd say try using S3 instead of S4 and see what happens, my guess it'll work.

Ok I will try S3. Shutter hibernates the computer and my Wakeup tasks still work without Wake On Lan. I know it is Hibernating because the only way to wake it is to press the power button once quickly(pressing any key does not work). In fact I can even remove the power cord from the computer and then replace it and the computer will come out of hibernation if I press the power button.

By the way, did you look at that msdn article?
 

BD2003

Lifer
Oct 9, 1999
16,815
1
81
Sure I looked at it, but it likely only affects wakeup behavior in S3.

I'm not familiar with shutter, so I havent the slightest idea how or why it works with hibernation.

Even if you could get it to work with S4, there's still no good reason for you to use S4 over S3 anyway (unless you leave it unplugged overnight).
 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
How do I make sure the DisableWakeEvent parameter is not set to True and at least eliminate that as the problem.

I am sometimes amazed the effort people will go through to fix something that isn't broken. I think your right, calling powrprf.dll via rundll32.exe calls that API with the parameter which disables wake events.

So, you can make sure it's called correctly by using a different application which doesn't do that. Shutter.exe your already using seems fine. Why all the effort to remove it if it is doing what you want and the built in utility is not? If you want a more 'official' utility, try psshutdown from Sysinternals/MS

 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
Originally posted by: BD2003
Sure I looked at it, but it likely only affects wakeup behavior in S3.

I'm not familiar with shutter, so I havent the slightest idea how or why it works with hibernation.

Even if you could get it to work with S4, there's still no good reason for you to use S4 over S3 anyway (unless you leave it unplugged overnight).

Why would you say that parameter only effects s3? RTC events work in S4 if they are not cleared (hence that last parameter)...

 

ManyBeers

Platinum Member
Aug 30, 2004
2,519
1
81
Originally posted by: bsobel
How do I make sure the DisableWakeEvent parameter is not set to True and at least eliminate that as the problem.

I am sometimes amazed the effort people will go through to fix something that isn't broken. I think your right, calling powrprf.dll via rundll32.exe calls that API with the parameter which disables wake events.

So, you can make sure it's called correctly by using a different application which doesn't do that. Shutter.exe your already using seems fine. Why all the effort to remove it if it is doing what you want and the built in utility is not? If you want a more 'official' utility, try psshutdown from Sysinternals/MS
Oh I agree with you Shutter works fine. I just thought all I would have to do to use rundll32 would be to append something after the S4 switch to make DisableWakeEvent parameter false or maybe modify a registry value. I'm currently in correspondence with a Microsoft tech via e-mail and they havn't been able to fix it either. If i have to i will just
have to go back to using Shutter. I didn't think fixing this would be so much trouble.

 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
Ive seen people (via Google) trying to do:

rundll32.exe powrprof.dll,SetSuspendState 1,1,0

(Actually they were doing rundll32.exe powrprof.dll,SetSuspendState 0,1,0) Anyhow, if additional parameters are accepted, thats likey to be the form. That should hibernate, immediately, not clear wakeup events.

 

ManyBeers

Platinum Member
Aug 30, 2004
2,519
1
81
Ok I will try a couple and see what happens. I will have to do this tonight and report back tomorrow. I went with 1 1 0.

 

ManyBeers

Platinum Member
Aug 30, 2004
2,519
1
81
Originally posted by: bsobel
Ive seen people (via Google) trying to do:

rundll32.exe powrprof.dll,SetSuspendState 1,1,0

(Actually they were doing rundll32.exe powrprof.dll,SetSuspendState 0,1,0) Anyhow, if additional parameters are accepted, thats likey to be the form. That should hibernate, immediately, not clear wakeup events.
Got It! Thanks bsobel. I was hoping all I needed was to get the right switches on the end.