Question: I have created scheduled tasks on both a Vista and Win7 machine which wake up the machine if it is currently in a sleep state. However, if the task takes longer than the power settings are configured on the machine, the machine will return to a sleep state. It looks like [this](http://www.catfood.net/blog/2008/12/prevent-sleep-during-scheduled-tasks.asp) utility might be a solution, but I was wondering if there were other options.

Does anyone know of a powershell command or other utility that will prevent my machine from going into a sleep state while a task is running?

Answer: 
There should be a checkbox in the options for scheduling a task. I don't have Win 7 in front of me at the moment so I can't say exactly where, just that I've used it before.
In task scheduler go to `properties - conditions tab - select 'Wake the computer to run this task'`. In W7 this also triggers the computer to **not** go to hibernate if the task is running
edit- as commenters have pointed out, this bug may not be fixed. I haven't experienced it which is why I figured it was fixed, but there are reports that it wasn't fixed between vista and 7, which is what the OP indicates. Three is [a thread](http://forum.acronis.com/forum/8985#comment-64200) over on Acronis with a script you can create and run with tasks that will stop the computer from hibernating. Additionally, there's a [post](http://iboyd.net/index.php/2010/10/15/scripting-a-scheduled-wakeup-in-windows-7-and-vista-too/) on this website about inserting `ping` into your tasks to stop the computer from hibernating.