Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

Task scheduler and sleep mode - Sleeps too soon

microsoft.public.windows.vista.performance maintenance






Speedup My PC
Reply
  #1 (permalink)  
Old 03-30-2007
Adam
 

Posts: n/a
Task scheduler and sleep mode - Sleeps too soon
If I create a scheduled task in Vista, set to wake the computer from sleep
mode, Vista wakes correctly, but goes back into sleep mode before the task
is finished.

I've seen a couple of posts here mentioning similar problems, and I'm
wondering if Microsoft are aware of the problem. I have the same problem on
two different PCs both running Ultimate (one upgraded from XP Pro, one with
Vista pre-installed).

The PC wakes up correctly at the time the task is due, starts to run the
task, but then goes to sleep after 1 or 2 minutes, usually before the task
has ended. When it next comes out of sleep (for whatever reason) the task
resumes. I've tried changing my power settings to put the PC to sleep after
various time periods from 15 minutes to 2 hours, but get the same effect.

It appears to happen regardless of the user the task is set to run under,
and whether the task is set to run in "Vista mode" or "2000/XP mode".

I've even tried to manually put the PC into High Performance mode (using
powercfg) as the first step in the task (the idea being to then put it back
into my standard power mode once it's finished), but it still goes to sleep
within a couple of minutes and before the task ends. Doing a powercfg -l
shows that the PC is in High Performance mode during the task (which, of
course, is configured not to sleep).

This is causing me real problems as my nightly backups aren't completing!

Any ideas?

Thanks.


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-31-2007
bc
 

Posts: n/a
Re: Task scheduler and sleep mode - Sleeps too soon
On Mar 30, 6:54 am, "Adam" <add...@yahoo.com> wrote:
> If I create a scheduled task in Vista, set to wake the computer from sleep
> mode, Vista wakes correctly, but goes back into sleep mode before the task
> is finished.
>
> I've seen a couple of posts here mentioning similar problems, and I'm
> wondering if Microsoft are aware of the problem. I have the same problem on
> two different PCs both running Ultimate (one upgraded from XP Pro, one with
> Vista pre-installed).
>
> The PC wakes up correctly at the time the task is due, starts to run the
> task, but then goes to sleep after 1 or 2 minutes, usually before the task
> has ended. When it next comes out of sleep (for whatever reason) the task
> resumes. I've tried changing my power settings to put the PC to sleep after
> various time periods from 15 minutes to 2 hours, but get the same effect.
>
> It appears to happen regardless of the user the task is set to run under,
> and whether the task is set to run in "Vista mode" or "2000/XP mode".
>
> I've even tried to manually put the PC into High Performance mode (using
> powercfg) as the first step in the task (the idea being to then put it back
> into my standard power mode once it's finished), but it still goes to sleep
> within a couple of minutes and before the task ends. Doing a powercfg -l
> shows that the PC is in High Performance mode during the task (which, of
> course, is configured not to sleep).
>
> This is causing me real problems as my nightly backups aren't completing!
>
> Any ideas?
>
> Thanks.


I have worked with MS support on this for 2-3 weeks. Here is the
latest thing they told me:

I can understand the inconvenience that this issue causes. Actually,
this issue can also be reproduced on test machines at our technical
support site. Therefore, we can confirm that the issue is not system
specific but is related to the programs and codes. I have immediately
forwarded this issue to the relevant team for further investigation.
Please be assured that our developers will look into this issue and
find a permanent solution. Your patience and understanding on this is
greatly appreciated.

So at least on some level they are aware of it. I asked if there was
any way I could track the progress of the issue, but was told no, that
I would be informed when a fix was available, but there was otherwise
no way for me to stay up to date on the status of the investigation.
So I am hopeful for a fix someday but am not holding my breath.
--
bc

Reply With Quote
  #3 (permalink)  
Old 04-01-2007
Adam
 

Posts: n/a
Re: Task scheduler and sleep mode - Sleeps too soon
> I have worked with MS support on this for 2-3 weeks. Here is the
> latest thing they told me:


Thanks for the info. At least they're aware of the problem.

A.

Reply With Quote
  #4 (permalink)  
Old 12-11-2008
TNSpearman
 

Posts: n/a
Re: Task scheduler and sleep mode - Sleeps too soon

I've always considered myself reasonably patient and understanding, but
considering that I'm still plagued by this problem more than a year and
a half after Microsoft confirmed that it is a problem and said that the
relevant team is working on a permanent solution, I'd have hoped for a
fix by now.


--
TNSpearman
Reply With Quote
  #5 (permalink)  
Old 12-11-2008
Brink
 

Posts: n/a
Re: Task scheduler and sleep mode - Sleeps too soon

TNSpearman;907676 Wrote:
> I've always considered myself reasonably patient and understanding, but
> considering that I'm still plagued by this problem more than a year and
> a half after Microsoft confirmed that it is a problem and said that the
> relevant team is working on a permanent solution, I'd have hoped for a
> fix by now.


Hello TNSpearman,

This tutorial may help you fix this problem by adjusting how long you
want the return to sleep time to wait for a unattended wakeup until
returning to sleep automatically.

http://www.vistax64.com/tutorials/17...d-wake-up.html

Hope this helps,
Shawn


--
Brink

*There are no dumb questions, just the people that do not ask
them.*
'*Windows 7 Forums*'
(http://www.sevenforums.com/) *and* '*::Vista Forums::*'
(http://www.vistax64.com)
*Please post feedback to help others.*
Reply With Quote
  #6 (permalink)  
Old 01-07-2009
TNSpearman
 

Posts: n/a
Re: Task scheduler and sleep mode - Sleeps too soon

Thanks for the link to the tutorial. I've solved the problem by going a
different route. Since I've written the program that I'm running under
Task Scheduler myself using Visual Basic I used the
"SetThreadExecutionState" API to keep the computer awake long enough to
execute the program. It took a lot of experimentation to figure out how
to declare and use the API properly since the documentation for it is in
C++, with which I am unfamiliar. In case I can help someone else avoid
the frustration, here's what works:

Declare Auto Function SetThreadExecutionState Lib \\"kernel32.dll\\"
(ByVal esFlags As Long) As Long

Public Sub Main()

SetThreadExecutionState(&H80000001)
' parameter is the hexadecimal sum of the ES_CONTINUOUS and the
ES_SYSTEM_REQUIRED flags

' rest of program goes here

SetThreadExecutionState(&H80000000)
' parameter is the hexadecimal value of the ES_CONTINUOUS flag

End Sub

Task Scheduler now wakes the computer up to run the program, it stays
awake as long as required to complete the program, then goes back to
sleep when finished.


--
TNSpearman
Reply With Quote
  #7 (permalink)  
Old 01-07-2009
Brink
 

Posts: n/a
Re: Task scheduler and sleep mode - Sleeps too soon

You're welcome TNSpearman. I'm happy to hear that you got it sorted.

Shawn

TNSpearman;931918 Wrote:
> Thanks for the link to the tutorial. I've solved the problem by going a
> different route. Since I've written the program that I'm running under
> Task Scheduler myself using Visual Basic I used the
> "SetThreadExecutionState" API to keep the computer awake long enough to
> execute the program. It took a lot of experimentation to figure out how
> to declare and use the API properly since the documentation for it is in
> C++, with which I am unfamiliar. In case I can help someone else avoid
> the frustration, here's what works:
>
> Declare Auto Function SetThreadExecutionState Lib \\"kernel32.dll\\"
> (ByVal esFlags As Long) As Long
>
> Public Sub Main()
>
> SetThreadExecutionState(&H80000001)
> ' parameter is the hexadecimal sum of the ES_CONTINUOUS and the
> ES_SYSTEM_REQUIRED flags
>
> ' rest of program goes here
>
> SetThreadExecutionState(&H80000000)
> ' parameter is the hexadecimal value of the ES_CONTINUOUS flag
>
> End Sub
>
> Task Scheduler now wakes the computer up to run the program, it stays
> awake as long as required to complete the program, then goes back to
> sleep when finished.
>



--
Brink

*There are no dumb questions, just the people that do not ask
them.*
'*Windows 7 Forums*'
(http://www.sevenforums.com/) *and* '*::Vista Forums::*'
(http://www.vistax64.com)
*Please post feedback to help others.*
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista - Sleep/network/task scheduler issue David Qunt microsoft.public.windows.vista.general 3 03-01-2007 12:18
Task Scheduler is weird Keith microsoft.public.windows.vista.general 1 03-01-2007 03:04
Task Scheduler 'How To' Jeff Gaines microsoft.public.windows.vista.general 2 02-28-2007 20:45
Vista Sleep Mode: Monitor Sleeps, PC...not so much =?Utf-8?B?TGluZGE=?= microsoft.public.windows.vista.performance maintenance 1 02-17-2007 03:27
Task Scheduler Problems =?Utf-8?B?TWFyayBC?= microsoft.public.windows.vista.performance maintenance 1 12-15-2006 00:19




All times are GMT +1. The time now is 15:35.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120