Date: 2009oct19
OS: Windows
Q. How can I ensure Windows doesn't powerdown when my long-running
batch script is executing?
A. I use the powercfg command to change the power plan
during the batch.
To see the GUIDs of your power plans. Then you can make a batch file
like this:
REM Turn on "high performance" power plan - We don't want it going
to sleep during this
powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
REM Do the thing that will take a long time
REM ... blah ...
REM Go back to the "balanced" power plan
powercfg -s 381b4222-f694-41f0-9685-ff5bb260df2e
powercfg was added in Windows 2003.
| What this info useful to you? You can donate to say thanks |
Add a comment
Sign in to add a comment