How to Disable Hibernation and Delete hiberfil.sys File in Windows 7

I recently addded 6 GB memory to my Core i7 workstation to be able to run multiple virtual machines at the same time. It’s not long before I found an issue with this setup. The partition for my Windows 7 is only 40GB. Even thought I didn’t install a lot of programs, my system drive ran out of disk space pretty quickly. I was puzzled at first. Then I realized the hibernation file takes a lot of disk space even though I don’t use it.

The hibernation file is called hiberfil.sys and it’s under the root of the system drive. It’s the file that system writes the contents of physical memory to when you put the computer to hibernation. The size is uaually the size of your physical memory. For my Core i7 machine with 9 GB of total memory, the hiberfil.sys is about 7 GB which takes up a lot of space.

If you use the power options in Control Panel, you can turn off hibernation. However, the hibernation file remains. To disable hibernation and delete the hibernation file, you have to use powercfg command line tool. Follow these steps.

  1. Open up an elevated command prompt.
  2. Type this command.
    powercfg -h off

That’s it. If you ever want to turn it back on. Just type powercfg -h on .

This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.


  1. oh man u saved my day.. i tried deleting it in linux on the same box after disabling hybernation in the power options, but it always came back..

    i got a 30GB SSD drive which contains my Win7, so i really can use the extra 4gb

  2. That is awesome. I have a 32GB ssd boot drive and was loosing space fast. this gave me back close to 4GB .
    Thanks heaps!!

  3. The stupid thing about this (Win7) is that in WinXP you used to be able to disable this directly from Control Panel > Power Options … just uncheck “hibernate”, and it would go away. But in Win 7, even though you disable hibernate in power profiles (IE: Hibernate = Never), it still keeps this damn file around. You have to manually hack it via the command line.

    For folks finding it annoying opening the cmd as admin, an alternate method would be to

    1) Create a new .txt file
    2) Copy/paste “powercfg.exe -h off” into it
    3) Save As or Rename the file to “power.bat”
    4) Right-click on it
    5) Choose “Run as admin”

    That will fire off the command as a batch file in admin mode and do the exact same thing. When you’re done, you can delete the file, or right-click edit the file to “powercfg.exe -h on” and keep the file some where in case you want to turn it back on some day.

  4. Thank you very, very much.
    Indeed, why “make it better”, that was fine and simple in WinXP with “hibernate” uncheck option?

  5. Sweet, saved me 4,5 GB ๐Ÿ˜€
    Thank you!

    I disabled the pagefile on C: also, enabled in on the ordinary HD if for some reason my 6GB should run out.

    (INSANE that the file isn’t removed like in winxp)

  6. Thanks man! my SSD was running out of high performance disk fast.. that hiber file really need to go… worked a treat… I just pressed Windows Key + R, and pasted that line “powercfg -h off” pressed enter.. viola, hiberfile gone.. sweeeet!!!!

Leave a Reply