![]() |
|
Welcome to Vista Banter. You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to ask questions and reply to others posts, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact support. |
|
|||||||
| Performance and Maintainance of Windows Vista A forum for performance and maintenance tasks in Windows Vista. (microsoft.public.windows.vista.performance_maintainance) |
|
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I have a task to run an executable. I have it set to run whether the user is
logged in or not, run with the highest privileges, wake the computer to run this task, stop the task if it runs longer than 8 hours. It runs at 1am. The task wakes the computer up at 1am fine, starts the executable, then puts the computer back to sleep without waiting for the executable (a VS2005 SP1 C# program I created) to complete. When I wake the computer in the morning, the executable resumes. What is up with this? Why can't the task scheduler wait until the task it spawned finishes? My vista installation was an upgrade from XP Pro. But I created the task (several times) from scratch in Vista. I also recompiled the executable in Vista. I have also tried the task in both "Windows Server 2003, Windows XP, or Windows 2000" mode and in "Windows Vista" mode. This is a huuuuuge step backward for me. I would appreciate any help anyone can offer for this. |
|
|||
|
|
|
|||
|
I will double-check this tonight, though, and change the power scheme to
just leave the machine on all night and see what happens. I can't find any other settings in the task's properties other than what I stated in my original post. If there's some "hidden" ones, I'm dying to find out. Hi Pete, Did you find a sollution to this? I'm having the same problem, although only with a batch file which backs up some files. It normally takes around 15 to 20 minutes to run, but I can see from the event log that although the Vista machine wakes up fine, it goes back into standby after about 7 or 8 minutes. My power settings tell the PC to go into standby after 1 hour. I can't see a "keep machine awake while running task" option in the task scheduler, which is exactly what I want. A. |
|
|||
|
STILL NO LUCK!!!!
This is just unbelievable to me! You would think that with all the talk about power saving and global warming, the LEAST that Microsoft could do would be to make a task scheduler that actually allows you to leave your computer in standby mode and only wake up to run a job or two and then go back to sleep. They had it right in XP pro, before I upgraded my machine to Visita this stuff worked flawlessly in XP Pro. Unless I find an answer to this, I won't be upgrading my Media Center 2005 box to Vista, because I have that box in standby 20 hours a day and waking up and recording, etc. Okay, now that my ranting is done, I just say that if I find anything out, I'll post it here. And if anyone has an answer to this, please let us know! Thanks. Pete "Adam" wrote: I will double-check this tonight, though, and change the power scheme to just leave the machine on all night and see what happens. I can't find any other settings in the task's properties other than what I stated in my original post. If there's some "hidden" ones, I'm dying to find out. Hi Pete, Did you find a sollution to this? I'm having the same problem, although only with a batch file which backs up some files. It normally takes around 15 to 20 minutes to run, but I can see from the event log that although the Vista machine wakes up fine, it goes back into standby after about 7 or 8 minutes. My power settings tell the PC to go into standby after 1 hour. I can't see a "keep machine awake while running task" option in the task scheduler, which is exactly what I want. A. |
|
|||
|
Humm... It's certainly annoying.
I haven't been able to find out anything about it, dispite spending several hours on Google. All I've found so far is http://technet.microsoft.com/en-us/w.../aa906020.aspx Which says "Task Scheduler wakes the machine to run the tasks and allows it to return to standby or hibernation when the task is complete, saving energy while still ensuring that critical tasks run on time." And our systems obviosuly aren't working like that - They're returning to standby mode before the task completes. I'll keep looking, and will post back here if I find anything. A. "Pete Furtado" wrote in message ... STILL NO LUCK!!!! This is just unbelievable to me! You would think that with all the talk about power saving and global warming, the LEAST that Microsoft could do would be to make a task scheduler that actually allows you to leave your computer in standby mode and only wake up to run a job or two and then go back to sleep. They had it right in XP pro, before I upgraded my machine to Visita this stuff worked flawlessly in XP Pro. Unless I find an answer to this, I won't be upgrading my Media Center 2005 box to Vista, because I have that box in standby 20 hours a day and waking up and recording, etc. Okay, now that my ranting is done, I just say that if I find anything out, I'll post it here. And if anyone has an answer to this, please let us know! Thanks. Pete "Adam" wrote: I will double-check this tonight, though, and change the power scheme to just leave the machine on all night and see what happens. I can't find any other settings in the task's properties other than what I stated in my original post. If there's some "hidden" ones, I'm dying to find out. Hi Pete, Did you find a sollution to this? I'm having the same problem, although only with a batch file which backs up some files. It normally takes around 15 to 20 minutes to run, but I can see from the event log that although the Vista machine wakes up fine, it goes back into standby after about 7 or 8 minutes. My power settings tell the PC to go into standby after 1 hour. I can't see a "keep machine awake while running task" option in the task scheduler, which is exactly what I want. A. |
|
|||
|
"Adds" wrote in message ... Humm... It's certainly annoying. I think I might have found away around this, although not ideal. In my batch file, I'm running powercfg first to set the PC into "High Performance" mode (powercfg /? will give the options). I then set it back to my normal power mode after the batch file has complete. I have to admit that I haven't given it long enough to test properly, but it appears to work. Not ideal I know, but at least it might be a work around. A. |
|
|||
|
"Adds" wrote: "Adds" wrote in message ... Humm... It's certainly annoying. I think I might have found away around this, although not ideal. In my batch file, I'm running powercfg first to set the PC into "High Performance" mode (powercfg /? will give the options). I then set it back to my normal power mode after the batch file has complete. I have to admit that I haven't given it long enough to test properly, but it appears to work. Not ideal I know, but at least it might be a work around. A. Interesting idea. I got so disgusted with this problem that I gave up for a while. Anyway, how has it worked for you? I will try this myself in the next couple of days. Thanks! Pete |
|
|||
|
I've got two Vista machines doing this as well. Using a batch file to switch
to high performance mode where sleep is set to "never" before the task runs doesn't fix the problem. Both machines drop back to sleep within a minute or two of task start regardless of power mode. I originally ran across this problem with defrag and thought it might have to do with the fact that defrag does low-priority (background) I/O, but I've reproduced the problem with several different disk I/O intensive tasks that use normal priority I/O so that's not it (and just in case anybody is wondering: removing the -i switch on defrag has no affect either). Looks like a Vista power management bug to me. Windows has certainly had it's fair share of these over the years. Lets hope the bug gets fixed in SP1 or (hopefully) sooner in an update. Clayton Gautier "Pete Furtado" wrote: "Adds" wrote: "Adds" wrote in message ... Humm... It's certainly annoying. I think I might have found away around this, although not ideal. In my batch file, I'm running powercfg first to set the PC into "High Performance" mode (powercfg /? will give the options). I then set it back to my normal power mode after the batch file has complete. I have to admit that I haven't given it long enough to test properly, but it appears to work. Not ideal I know, but at least it might be a work around. A. Interesting idea. I got so disgusted with this problem that I gave up for a while. Anyway, how has it worked for you? I will try this myself in the next couple of days. Thanks! Pete |
|
|||
|
In case anyone still cares about this issue, I've come up with a work-around.
It involves the Win32 API function SetThreadExecutionState (kernel32.dll). You can find the details on the web, but basically, Windows can be forced to stay awake while a process runs by sandwiching the process between two SetThreadExecutionState calls (with different arguments for the calls). The sandwiching can be implemented in a variety of ways - I chose to create an executable, named StayAwakeExec in VB 2005 Express Edition (free) that does the following: 1) makes the first call to SetThreadExecutionState to block sleep 2) spawns an executable passed in as a command line argument 3) makes the second call to SetThreadExecutionState to allow sleep after the spawned executable exits Note that the "after the spawned executable exits" part of Step 3 is implemented by calling Process.WaitForExit() for the spawned executable. I've successfully used StayAwakeExec to spawn defrag.exe with a task that wakes the computer at 1AM. The computer now wakes, runs defrag to completion, and then goes back to sleep immediately after the defrag finishes (as verified by the system log file). I was hoping that the latest Vista performance and reliability patches (KB938194 and KB938979) would fix the bug, design flaw - whatever you want to call it - that made this workaround necessary, but alas, twas not so. I tested both my systems after installing these patches and Vista still falls asleep almost exactly 2 minutes after a scheduled task wakes the computer regardless of whether the task is done. My expectation (and I'm pretty sure most people would agree) is if you check the "Wake the computer to run this task" checkbox on the Conditions tab in Task Schedular, Windows should stay awake until the task is complete. It should be a simple matter for an MS developer to add to the task schedular service the sandwiching calls to SetThreadExecutionState to prevent sleep if "Wake the computer to run this task" is checked. Hopefully SP1 will have this fix. "clayga" wrote: I've got two Vista machines doing this as well. Using a batch file to switch to high performance mode where sleep is set to "never" before the task runs doesn't fix the problem. Both machines drop back to sleep within a minute or two of task start regardless of power mode. I originally ran across this problem with defrag and thought it might have to do with the fact that defrag does low-priority (background) I/O, but I've reproduced the problem with several different disk I/O intensive tasks that use normal priority I/O so that's not it (and just in case anybody is wondering: removing the -i switch on defrag has no affect either). Looks like a Vista power management bug to me. Windows has certainly had it's fair share of these over the years. Lets hope the bug gets fixed in SP1 or (hopefully) sooner in an update. Clayton Gautier "Pete Furtado" wrote: "Adds" wrote: "Adds" wrote in message ... Humm... It's certainly annoying. I think I might have found away around this, although not ideal. In my batch file, I'm running powercfg first to set the PC into "High Performance" mode (powercfg /? will give the options). I then set it back to my normal power mode after the batch file has complete. I have to admit that I haven't given it long enough to test properly, but it appears to work. Not ideal I know, but at least it might be a work around. A. Interesting idea. I got so disgusted with this problem that I gave up for a while. Anyway, how has it worked for you? I will try this myself in the next couple of days. Thanks! Pete |
|
| Thread Tools | |
| Display Modes | |
|
|