Josh Cooper
, , ,
No Comments


I have an EVGA GTX 580 video card, and either Windows or its driver has a bug. When my computer wakes up after sleeping just about any game I play will crash. It doesn’t happen right away, usually I can start a 5v5 dota match and the game will crash in the middle of a draft; if it’s ability draft, usually just as it is my turn to pick abilities(thus forcing me to have randomly selected abilities). No big deal, just go disable sleep, and hibernation for good measure.

What if you happen to be reinstalling windows frequently, but don’t want to manually configure this? Well you’re gonna have to create a batch file to do it. Well there is a hitch in this plan, and that’s the powercfg is designed rather ridiculously. Apparently it uses entirely GUIDs, which are rather long and difficult to memorize (more so than your windows product key). So what’s a person to do?

Luckily there is a nice fellow who’s gone and recorded all of the GUIDs necessary. There is just one problem left, the power profile to apply the changes to must be specified. Now you could certainly apply the changes to all of the default profiles. I didn’t though, I wanted only to change the active profile. This felt like the best, most flexible, solution.

So, as you’ve gathered, I made a batch file to disable sleep and hibernation for the currently active power profile. It should be run as an administrator. Enjoy!
Here it is.

cls
echo OFF
for /f "tokens=4" %%a in ('Powercfg -getactivescheme') do set profile=%%a
SET group=238c9fa8-0aad-41ed-83f4-97be242c8f20
SET sleepafter=29f6c1db-86da-48c5-9fdb-f2b67b1f44da
SET hybridsleep=94ac6d29-73ce-41a6-809f-6363ba21b47e
SET hibernateafter=9d7815a6-7ee4-497e-8888-515a05f02364
echo ON
powercfg -setacvalueindex %profile% %group% %sleepafter% 0
powercfg -setacvalueindex %profile% %group% %hybridsleep% 0
powercfg -setacvalueindex %profile% %group% %hibernateafter% 0
powercfg -h off

Cheers!

Resources: