Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
4.50/5 (3 votes)
See more:
Is there a way of temporarily preventing Windows from being put to sleep? I have this nasty habit of pressing the sleep button on my laptop while Norton Ghost is doing a backup. This usually wrecks the backup volume and takes time and effort to re-build.

I know how to prevent windows from shutting down but havent found anything about stopping sleep. The idea would be to have Ghost run a prog before it starts the backup then run another when its finished.
Posted
Comments
Sergey Alexandrovich Kryukov 4-Mar-14 14:51pm    
Good, practically important question (I already voted 5, but then realized that it could be considered off-topic, because it's not about programming, just about using of the system; bat it's okay; by the way, this is unrelated to C++, why did you tag it?). There are cases when it is needed.
You can easily prevent sleeping by timer, but I don't know exactly how to disable this function at all. Try to do the search...
—SA

If some power option is configurable in principle, it can be done by the utility powercfg.exe:
http://en.wikipedia.org/wiki/Powercfg[^],
http://technet.microsoft.com/en-us/library/cc748940%28WS.10%29.aspx[^] (official Microsoft documentation page),
http://technet.microsoft.com/en-us/library/cc748940%28v=ws.10%29.aspx[^].

Also, use
powercfg /?
to see the options. You may need to run it "As Administrator: http://www.sevenforums.com/tutorials/11841-run-administrator.html[^].

—SA
 
Share this answer
 
v2
Awesome - thanks Sergey, that looks like just what I need! I can set up a power scheme that does nothing when you press the power button then use a script to switch to that power scheme before the backup starts and switch it back afterwards.

Thanks again!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900