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 .

  • DM

    Thanks for that tip! They sure didn’t make it intuitive this time around…

  • tanx, i needed that…

  • TB

    Thanks a ton! Very handy! Worked on retail and RC build.

  • Raj Shah

    This works but the file keeps coming back after about 2 reboots… How can you permanently turn it off?

  • Akos


    it does not work for me. It says I do not have the rights although I am admin.
    Any idea?


  • Akos

    Forget it worked. I was admin, but not the CMD. 🙂

  • 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

  • Gintus Mcgloski

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

  • blah blah black sheep

    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.

  • Dan Maor

    Man, I found this post via Google, and you just helped me get back 8 gigs of my system hard driver!

    Thank you sir!

  • Uther Lightbringer

    That is great. Win7 on a small 64GB SSD drive and 8 Gigs of RAM. 6,9 Gigs more space now on the HD! Thanks a lot, man!

  • Alexander Tulchinsky

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

  • balamurugan.k.p


  • Asgeir

    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)

  • Arrows

    Thanks very much for this good advice.. now i can free up my hard drive too.

  • Mobiles

    thanks it helped on hard disk space

  • Shaggy

    Thanks a LOT man!! You’ve just saved my 2gb space! hats off!!

  • cicci

    thanks for the tip mate saved me 4gb on my ssd ^^

  • Grifi

    Thanks a lot, man!

  • 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!!!!

  • nandi

    Great tip, thanx a lot 😉

  • Mohammad

    thanks its working but you should run command prompt as administrator

  • Marshall

    Full step by step guide on how to do this with screenshots here: