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!

  1. nonW00t says:

    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. ChicenLiddle says:

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

  3. Jeff Shickele says:

    First time here, I'll definitely be back.


  4. Leonard says:

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

  5. Wally says:

    Thanks for this tutorial! I tried turning off Hibernation in Power Options, but that would not get rid of the hiberfil.sys file! Your method worked perfectly. Thanks!

  6. Andrey says:

    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.


  7. fazell says:

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

  8. cputman says:

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

  9. j.pradeep says:

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

  10. jilalf says:

    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".

  11. frostfire says:

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

    Try this instead:

    powercfg /h off

  12. dani says:

    thank u kindly !!!

  13. Edgeman says:

    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.

  14. DAVE MILLER says:

    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?

  15. DAVE MILLER says:

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

  16. Doc says:

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

  17. CrisPBacon says:

    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.

  18. Peter says:

    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

  19. callme says:

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

  20. DanielAlvarado says:

    This worked just fine. =D

    Thank you.

  21. firewall says:

    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.

  22. Gary says:

    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.

  23. Micmc42 says:

    Worked the first time. Thanks!

  24. Babalaba says:

    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.

  25. noname says:

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

  26. shaun says:


    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.

  27. Warlockz says:

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

    powercfg.exe -h off


    powercfg -h off

  28. SoundLogic says:

    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.

  29. chimonds says:

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

  30. Ahmed says:

    Works for me with power -h off.

    Thanks a lot.

    Home premium

  31. Matt says:

    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.

  32. Adyy says:

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


  33. shawn says:

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

  34. dooD says:

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

  35. Whatthe says:

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

  36. maryyugo says:

    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.

  37. edlogic says:

    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

  38. Pai says:

    Great info, Thanks!! ^_^

  39. siva says:

    awesome.. it's worked….

  40. Travis Stein says:

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

  41. Vikram says:

    Thanks a lot. First step worked fine.

    No need for second step.

  42. droppedgt says:

    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.

  43. kyfan says:

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

  44. Speedycus says:

    Cmd prompt worked like a charm. THANK YOU!

  45. Ryan K Tuiring says:

    run CMD as Administrator

  46. Jon woellhaf says:

    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.

  47. Gosa says:


    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.

  48. arun rana says:

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

  49. Rodney says:

    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.

  50. Michael A says:

    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?

  51. Tony says:

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

  52. {NOC}JUDGE says:

    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. :)

  53. Dan says:

    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

  54. zoltee says:

    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

  55. gimpymoo says:

    Many thanks, worked first time.

    powercfg /h off

  56. john says:

    thanks-got back 12GB on my ssd

  57. Priyanka S says:

    Hi, Thanks a lot. worked great..

  58. Jojo says:

    Works perfectly.. and remove my headache :) thanks

  59. Roland says:

    It’s not case-sensitive.

  60. Roland says:

    Either works. -HIBERNATE, -H

  61. Roland says:

    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.

  62. Roland says:

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

  63. Roland says:

    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.

  64. kipi says:

    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).

  65. John Q says:

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

  66. Robert says:

    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.

  67. debianftw says:

    ‘powercfg -h off’ worked on win7hp 64bit

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

  68. debianftw says:

    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)


  69. bobi says:

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


  70. Trythis says:

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

  71. Ben says:

    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.

  72. Paul W says:

    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’.

  73. Jason says:

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

  74. MBrando says:

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


  75. Ticklesniffer says:

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

  76. Tarnix says:

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

  77. TedBellhop says:

    Official Microsoft KB on the subject:

  78. Jim says:

    Many, many, thanks!

  79. Ram says:

    Thanks for the post ..its worked for me …

  80. onimo says:

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

  81. Eddy says:

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

  82. Balakai says:

    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 “

  83. Steven Stevenson says:

    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