prevent sleep in scripts

Posted by Mr Fooz on Super User See other posts from Super User or by Mr Fooz
Published on 2010-01-02T15:39:11Z Indexed on 2010/03/29 12:13 UTC
Read the original article Hit count: 355

Filed under:
|
|
|

Is there a way to prevent Windows from going into sleep mode while running a program on the command line or with cygwin? Ideally, I'm hoping for something that could be used like:

nosleep myscript.sh

Background

Sometimes I start up long-running jobs like a manual backup or large file transfers and I've found that Windows often goes to sleep before these finish. I'd like to be able to start up the command and prevent sleep mode while the command is running, but have it automatically work again once the command has completed.

© Super User or respective owner

Related posts about sleep

Related posts about windows-7