Force Hibernation with Hybrid Sleep

160

Windows Vista introduced a very nice feature called “hybrid sleep” that simplifies power management and allows the PC to enter a deep sleep state (S2 or S3) while persisting the RAM contents to disk. In this case, even if the computer lost power it could always resume its state without data loss.

I like this feature quite much and it appears to have become the default “sleep” state on most operating systems (Mac OS X had it for some time and the latest Ubuntu appears to use Hybrid Sleep as well by default). In some cases however you'd perhaps want the PC to hibernate and skip the sleep state altogether (i.e. enter the S4 state directly). Unfortunately Windows hides the hibernate option: your only option is to enter sleep, wait until the RAM state has been written to disk and then power off the computer manually.

Needless to say, this is ugly and could lead you to powering off the PC before it had a chance to write all data to disk. In order to force Windows to enter hibernation directly (without having to disable Hybrid Sleep), you'll need to run the following command from the command line (no need to run as administrator):

%windir%\system32\rundll32.exe PowrProf.dll, SetSuspendState 0,1,0

This will quickly fade out the screen, save the RAM to disk and power off the computer as if you clicked on the old “hibernate” option.