I have sifted through lots of ways to enable/disable sleep mode on Windows 7, but what I'm looking for and can't find, is there a way to disable sleep mode and hibernation when a specific program is running?

I don't want Windows to sleep when I do hour longs prints as it doesn't always function correctly.

| improve this question | | | | |

You can create your own power plan from
Control Panel\All Control Panel Items\Power Options\Create a Power Plan

where you can unset sleep and hibernation timer(set to zero), then start your program from cmd file that contain command to switch to sleepless plan and restore it when you done.

When you created your sleepless plan, list all power plans by running from command line following command:

powercfg -LIST

that will return something like this:

Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e  (Balanced) *
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a  (Power saver)

then write somewhere GUID strings for sleepless and usual plan and create cmd file like:

@echo off

:: Below activating sleepless plan, replace GUID with plan you created
POWERCFG -SETACTIVE  8c5e7fda-e8bf-xxxx-xxxx-xxxxxxxxx


:: Restore usual power plan
POWERCFG -SETACTIVE 381b4222-f694-41f0-9685-ff5bb260df2e
| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.