Windows 7 – Delete Hibernation File (hiberfil.sys)

I’ve previously written a post explaining what the hiberfil.sys file is and how you can remove it in Windows Vista. In Windows 7, you the hibernation file can still take up a large amount of space on your hard drive.

In this post, we will show you how to delete the hiberfil.sys file and how to turn off hibernation. You can free up a decent amount of space by doing this.

Delete Hiberfil.sys File

To delete this file, you have to use the command prompt to manually turn off hibernation. If you turn off hibernation via Power Options (which I will show you next), it will not delete the actual file itself.

Open a command prompt in Windows 7 by typing command in the search box. Right click Command Prompt and choose Run as Administrator.

delete hiberfil sys

To turn off or disable hibernation, type the following command at the prompt:

powercfg –h off

This will disable hibernation and will remove the hiberfil.sys file from your system.

Turn Off Hibernation in Windows 7

To disable hibernation in Windows 7, you have to go into Power Options and click on Change plan settings.

disable hibernation

Then click on the Change advanced power settings link at the bottom.

remove hiberfil.sysNow expand Sleep and then expand Hibernate after. Change the value of On battery and Plugged in to 0 minutes. Note that the option will not even be available if you turned off hibernation using the command line.

turn off hibernation

That’s pretty much it! Hopefully, you can reclaim some lost disk space by getting rid of the hiberfil.sys file in Windows 7. Enjoy!

Comments [84]

  1. Could you be any more confusing? Why the second step? You state "To turn off or disable hibernation, type the following command at the prompt: powercfg –h off This will disable hibernation and will remove the hiberfil.sys file from your system." So then why do you include the next section about turning it off in the advanced power settings but say "Note that the option will not even be available if you turned off hibernation using the command line"?????

  2. Strange, trying -h off kept saying invalid parameters, but -hibernate off worked. Home Premium retail upgrade (installed fresh) if matters.

  3. First time here, I'll definitely be back.


  4. powercfg -hibernate off, that is the correct command to disable hibernation in Windows 7.

  5. If you do powercfg /? you will see that "powercfg -H off" is correct usage as well, H must be caps not lower case as in article.


  6. thanks a lot! Really wanted to delete that hibernation file! :)

  7. When I use any of these commands at the Command Prompt, I am told "Access is Denied"

  8. Thanks so much! I finally got rid of the pesky hiberfil.sys file!

  9. At least it helped somewhat. Maybe a question of W7 version: I instaled "Enterprise", where the command (cut/paste) did not work this way. After changing the -h option into /h (which better conforms to windows standards) all went well. So I'd like to suggest, type "powercfg /h off" instead of "powercfg –h off".

  10. powercfg -h off does not always work even though it is stated in the /? help.

    Try this instead:

    powercfg /h off

  11. powercfg -h off worked for me!
    Win 7 Enterprise x64.
    I had already tried disabling hibernation via the GUI as described here on my own, and was annoyed that I still had that pesky hiberfil.sys.
    powercfg -h off removed the hiberfil.sys immediately after running.

  12. Using Windows 7 Home Premium, I entered at Command: powercfg -h off and got the message "You do not have permission to enable or disable the Hibernate feature."

    I am supposedly the top level of security, as the pc was delivered to me, a stand-alone, so what do I do to make the change?

  13. “powercfg /h off” instead of “powercfg –h off” got the same security response

  14. No prob with "-h off" in Win7 Ultimate x64. Thx for the trick ;)

  15. This command works perfectly fine on Windows 7 Ultimate. If you read the powercfg /? it CLEARLY states the command is -HIBERNATE, -H and the Usage: POWERCFG -H

    Case is not sensitive on the command.

    Not sure why people have issues with stuff like this. I does describe in the article that the command prompt needs to be run as administrator for it to run. This solves the "access is denied" error.

    Others putting in -h off… umm, it's powercfg -h off

    Your missing the command >_>

    Copy and paste works different in command prompt. Copy the command from here. Go to the command prompt and click the top left corner of the window. A menu should appear. Click Edit then Paste.

  16. I reclaimed almost 4GB from my limited SSD storage.

    I used powercfg -hibernate off, and didn't try -h but I checked the command after, and that should work too.

    OS is Win 7 HP.

    You can also specify the file size if you do want to keep hibernate on, in terms of percentage of total memory (50% and above only allowed), using

    powercfg -H -Size

  17. Great tip thanks, saved 2.5gigs of space… and as easy to do as blinking.

  18. This worked just fine. =D

    Thank you.

  19. In case you run into permission trouble (as Dave Miller), make sure the command window from which you're issuing the powercfg has ADMIN rights.

    An easier way to achieve this: Click the Orb and type cmd. The Cmd.exe will be listed under programs. Right click on it and select Run as Admin. Click OK at the security prompt. Then issue the powercfg -h in the command window.

  20. It's actually "powercfg –H off" in Windows 7 Ultimate. I can't imagine it's case sensitive. I think this author just forgot to uppercase it.

    If you do "powercfg /?", it will tell you the options for hibernate, but "powercfg -HIBERNATE off" will work too.

  21. If you get access denied, run the command prompt with elevated permissions (UAC, as administrator).

    Click Start, in the search type CMD (don't hit enter). At the top of the search results is the command prompt. Right click, and choose "Run as Administrator." When UAC asks you to confirm, click "Yes." Then, do the powercfg commands.

  22. In Windows 7, copy and paste this, if it doesn't work: POWERCFG -H OFF

  23. Hello.

    Just thought I'd say that there is also a keyboard shortcut to elevate your privileges instead of right clicking.

    Type cmd in run box, hold left CTRL + left SHIFT and don't release. While those two keys are pressed, press Enter. Your command prompt should now say: C:Windowssystem32.

    This confirms that you're elevated to admin.

  24. If your getting Invalid Parameters, you are missing the .exe in the command which should be:

    powercfg.exe -h off


    powercfg -h off

  25. The first one works in Windows 7 Ultimate 64, but there seems to be a lot of inconsistency between versions from what everyone is saying. For me, I already had hibernation turned off, but confirmed that before I ran the command line, as somehow a 4 Gig file showed up when I asked Windows 7 to show protected system folders. I'm running a tight shift with only 64 GB as my main hard drive. I ran into this after SP1 was installed, and I am wondering if it may have something to do with that.

  26. Thanks. Just wanted to get rid of the file. Worked like magic.

  27. Works for me with power -h off.

    Thanks a lot.

    Home premium

  28. I noticed the command works if you type it and not if you cut and paste it from this page. It's because the example incorrectly has a '–' instead of a '-' (not the same!)

    You don't need .exe or / for it to work.

  29. "power -h off" works for me with Win 7 Ultimate


  30. The actual command is powercfg -H OFF at the elevated command prompt. -h (lower case) is invalid

  31. use this "powercfg.exe -h off" not "powercfg –h off" ! Geeze enough confusion.

  32. Thank you for the tip! This made it painlessly easy to clean it out after it got infected with a virus.

  33. Thanks a lot! What worked for me (Win7 Home Premium) was POWERCFG -H OFF all caps. It didn't work in lower case for some reason.

  34. powercfg -h off kept saying error

    if i type powercfg -h /h
    i get
    Hibernation state must be "on" or "off"

    so then i typed
    powercfg -h "off"

    and it worked and the hiberfil.sys file is gone

  35. Thanks a lot! Saved me 3 gigs on a SSD drive where space is a premium :)

  36. Thanks a lot. First step worked fine.

    No need for second step.

  37. I’m sure Unlocker the program can remove it. I had a program locked using it called Vgasave .. also booting into linux live distro you can delete and view any file from windows as it doesn’t care about microsofts silly security.

  38. Using home premium, got it to work with "powercfg -H off". the "-H" is case sensitive.

  39. Cmd prompt worked like a charm. THANK YOU!

  40. In windows 7 Ultimate 64-bit, I found when I right clicked <Command Prompt> via <Start> I didn't get a <Run as administrator> right click choice. I went to <Start |
    All Programs | Accessories> and right clicked <Command Prompt>. This gave me the <Run as administrator> choice. I clicked that and clicked <Yes> in the UAC dialog that popped up. I was then able run <powercfg -h off>. When I looked at the C drive, <hiberfil.sys> had been deleted.

  41. Hi,

    Very strange but this didn't work: powercfg -h off
    This did work: powercfg -h "off"

    So with quotes it worked for me.
    Thought to post it here, if anyone else has the same problem.

    Thanks for this post.

  42. thanks man …. its works for me on win 7 ….. it occupy around 2 gb of space …..thanks man really

  43. Thanks for your post! It helped but I still had a stubborn hiberfil.sys that didn't get deleted the first time I followed your procedure. Either there were initially 2 hiberfil.sys files or only part of the file got deleted when I turned hibernation off at the command line the first time. After much gnashing of teeth, I turned hibernation on again and then off and that got rid of the hiberfil.sys file.

  44. I use powercfg.exe -h off in an elevated command prompt and get “powercfg.exe is not recognized as an internal or external command, operable program or batch file.”

    Any thoughts on that?

  45. u the best!!!! "powercfg –H off" with uppercase on "H" works…. thanks man!

  46. Hi dave thank you for helping me delete that 15 Gig of hiber crap, i have looked @ the pagefile.sys as well. But i think i have won half the battle. i now have an extra 15 Gig in my 60Gig ssd HDD. thnx dave it worked sweet. :)

  47. Wow you must think people are retarded. Try not to be such a jerk.

    I seriously doubt anyone read this article and then went to their command prompt and typed “-h off”.

    As someone with 20 years of PC technical support experience, I can confirm that the options as listed in the command’s help do not always work. I’m running Win 7 Home Premium x64 the following commands did NOT work for me:

    powercfg –h off

    powercfg –h OFF

    powercfg –H off

    powercfg –H OFF

    powercfg –hibernate off

    The one that did work for me was:

    powercfg /h off

  48. The dash ‘–’ in the tutorial has the char code 2013, so it’s not a real dash (the real dash has the char code 2D). Probably it was copied from word or outlook or something that replaces the chars as you type.

    Please use:

    powercfg -h off

  49. Many thanks, worked first time.

    powercfg /h off

  50. Works perfectly.. and remove my headache :) thanks

  51. Since your post is dated, this is for others. This means you didn’t run the command prompt (cmd) in Administrative mode. It’s the very first direction you get from the OP. However, there is an easier way.

    Instead of using your mouse, press the Windows key, type in cmd, hold down CTRL+SHIFT with your left hand and press ENTER with your right. You are now in Administrative mode aka running as Administrator.

    Now you can enter the command: powercfg -h off

    Then thank the OP for taking the time to help us all out.

  52. If you don’t have a file in the root of your primary partition, labeled hiberfil.sys, then your “tight ship” needs further investigation.

  53. I doubt that was your issue and resolution. Quotes used in Windows OS on the command line are for spaces not desired as delimiters. Ex. c:\>cd “Program Files”. The space is part of the folder name and not a delimiter.




    Enables-Disables the hibernate feature. Hibernate timeout is not

    supported on all systems.

    Usage: POWERCFG -H

    POWERCFG -H -Size

    -Size Specifies the desired hiberfile size in percentage of the

    total memory. The default size cannot be smaller than 50.

    This switch will also enable the hiberfile automatically.

  54. Little late to the party but oh well.

    Cutting and pasting from the webpage itself will not work. Gives invalid parameters error. However when you delete the ‘-‘ and type it in yourself (and keep the rest of it the same) it works (well for me on windows 7 anyway).

    Guessing some format/ascii code messing up with webpagings. Hyphens, en dash, em dash ect (is my guess anyway).

  55. It would be what most humans call an “alternative method”.

  56. Thank you,I always wondered[when using defraggler] what that blob of space was.

    As well as making my pagefile 2GB instead of 8GB,Iv’e regained over 20GB of space,as well as finding that Overclocking my i7 2600k to 4.5GHz is running cooler[38c instead of 44c] than 4.4GHz[raised multiplier,turned OFF Turbo,turned ON C1E,Auto voltage=Stable],it’s been a successfull day CHEERS.

  57. ‘powercfg -h off’ worked on win7hp 64bit

    +1 for kipi above.. learn to type peoples!

  58. using character map application you can see that most fonts have multiple dashes, each with their own ascii code of course.

    eg. arial

    hyphen-minus (u+002d)

    soft hyphen (u+00ad)

    modifier letter minus sign (u+02d7)


  59. hi, anyone here know how to open a saved hiberfil.sys after the windows have started normaly(without reading the file)?


  60. If you copy-paste, the wrong dash (-) will be pasted. Try deleting it and manually typing it.

  61. powercfg -h off

    worked right away for me. I did not copy-n-paste. Gotta say this is the strangest thread ever; how could such a simple command trip so many people up? But then we’re dealing with an MS app.

  62. You said to tell it Hibernate ‘1080 minutes’. If you tell it ‘0 minutes’ then go out of there and return, it reads as Hibernate ‘Never’.

  63. Worked great! Freed up 15GB in my 60GB SSD! Thanks!

  64. WUHUUUUUUUU. Thank you very much. My hard drive can finally breath again. Im really, really thankful, as none of my so called “computer expert” friends could help me, get any further with the problem of my system hard drive having only 50kb of free space left!!! And you know, how much pain in the **** this is :>!. Now, with just a few clicks, I acquired 3GB more on my system disk :DDDD

    No more headaches, breakdowns, thinking bout smashing the laptop, or burning it!!


  65. I got the same error. Try all CAPS, it worked for me.

  66. Windows options usually uses slashes, not dashes. try “powerfcg /h off”

  67. Thanks for the post ..its worked for me …

  68. Thanks for the post…it worked for me too! THANK YOU VERY MUCH!

  69. Thanks recovered about 10 Gb after deleting the hyberfil.sys file.

  70. worked like a charm. i turned off hibernation from the screen saver advanced settings and hiberfil.sys was still there so i used your advice, with the command prompt ” powercfg –h off “

  71. I had trouble with the powercfg command not being recognised, sporadically, presumably it’s buggy.

    Typing powercfg /h off
    ALWAYS works, i.e. type ‘/’ instead of ‘-‘

Leave a Reply

Your email address will not be published. Required fields are marked *