How to Make Hibernation Work Better on Your PC


Many of us hibernate our PCs instead of turning them off. This provides a quick way to restart while using less power than the “Sleep” mode. This is particularly useful in laptops. Hibernation works by placing  the contents of RAM in a hidden system file called “hiberfil.sys”. In Windows XP and Vista, this file is the same size as the amount of RAM that is installed on the PC. In Windows 7, the default is 75% of the RAM size. This file is always in the root of the drive with the Windows folder or normally the C: drive.

Deleting and restoring hiberfil.sys

It has become common to have a rather small volume for the C: system drive. It has also become common to have 4GB or more of RAM. This means that hiberfil.sys can take up a substantial portion of your system drive. If drive space becomes critical, you may wish to delete the hiberfil.sys file and turn off hibernation. Because hiberfil.sys is a super-hidden system file, the usual way to delete a file does not apply. However, there is a very simple way that uses the command line run as administrator.

Open a command prompt run as administrator and enter
    powercfg –h off

That’s all there is to it. To restore the file enter
    powercfg –h on

These changes take place right away

The command-line method is also useful for dealing with a corrupt or badly fragmented hiberfil.sys file. In the process of going in and out of hibernation many times, the file sometimes becomes corrupted. Deleting the file and then restoring it will clean up the file.

Changing the size of hiberfil.sys

If you wish to retain hibernation but want to reduce the size of hiberfil.sys, that can also be done in the command line.  The file can be reduced to a smaller percentage of RAM with the command "powercfg –h -size <percent size>”. The command must be run as administrator. For example, to reduce hiberfil.sys to 50% of installed RAM, use
    powercfg –h -size 50

Percent size cannot be smaller than 50.

Get your own favorite tip published!  Know a neat tech tip or trick?  Then why not have it published here and receive full credit?  Click here to tell us your tip.

This tips section is maintained by Vic Laurie. Vic runs several websites with Windows how-to's and tutorials, including  a computer education website and a site for learning about the command line.

Click here for more items like this. Better still, get Tech Tips delivered via your RSS feeder or alternatively, have the RSS feed sent as email direct to your in-box.

Please rate this article: 

Your rating: None
Average: 3.7 (23 votes)


powercfg -hibernate off
powercfg -hibernate -size 50

I kept getting an error "Permission Denied" although I am logged in as administrator. I created a text file with the command I wanted and included a pause to see the results. And renamed the file extension to .bat.

I copied the file in windows\system32 folder and then right clicked to run it as administrator.

The file ran and the hybersys file was reduced to 50

The steps are create a text file on your desktop.

write or paste the command you want.
I used :

powercfg -hibernate -size 50

Then save and rename the file extension to .bat

copy it to windows\system32 folder and run it as administrator.
Hope this helps a few who are stuck like me with the error that you need to login as admin although you are the admin.

Being just logged in as administrator isn't sufficient. You have to also specifically run the command line as administrator.