How to disable or enable hibernation



If you used Space Investigator to analyze the contents of your C: drive, you probably couldn't help but notice a rather large file named hiberfil.sys in the root folder. This file is used by Windows to remember the state of your computer when you hibernate it.

OK, but what if you never hibernate your computer? (In most cases sleep is what it does, which is not the same as hibernate). The size of this file is about the same as the size of the RAM your computer has, it would be nice to delete the file and allow other files use that space. However, if you attempt to delete the file directly (using Space Investigator, AB Commander, or Windows Explorer), you might be surprised to discover that Windows does not let you delete it, even if you use your full powers of the administrator.

To solve this problem, you need to disable hibernation: when you do that, Windows deletes the hiberfil.sys file for you. Windows XP offers a special button in its Control Panel that you can use to disable or enable hibernation. However, Windows Vista and Windows 7 for some reason don't offer a similar command. Fortunately, there is a way to disable or enable hibernation: by running the powercfg.exe command with the administrative privileges and the appropriate command line switches, as described in this Microsoft article.

If you have AB Commander, you might be surprised to know that it can be used to achieve the same result especially easy. To do this, you need to know three things:

  1. AB Commander lets you launch any command by entering it into its command bar (at the bottom of AB Commander window).
  2. You can start a command elevated (a.k.a "As Administrator") by pressing the Ctrl+Shift+Enter keys.
  3. You have to know the correct command (and any parameters, if applicable) to run to perform the specific task you want.

For turning the hibernation on and off, the above mentioned Microsoft article gives us all information we need:

To disable hibernation, run this command:

powercfg.exe /hibernate off

To enable hibernation back, run this command:

powercfg.exe /hibernate on

Remember to launch these commands "As Administrator", or they won't work:

Press Ctrl+Shift+Enter to run a command As Administrator with AB Commander

Happy computing!

More information