What is hiberfil.sys and how to delete in Windows 7 free up hard drive space

As from our last post, why your hard drive is always shrinking even though you did not do anything, we talked about using the freeware TreeSize to view where you have the largest chunk of data on your hard drive. If you look deep enough you will found out that there are two files called pagefile.sys and hiberfil.sys that occupy over few GB of hard drive space. If you are the kind person that does not use Hibernate then this article is for you.

When you turn off your computer using hibernate, the operating system needs to store all your current running program states onto hard disk so that programs can resume where they left off when you power up your PC again. To achieve this, the OS need to save all the information into a file called hiberfil.sys. Windows OS (7, vista, XP) usually stores this as a hidden file under your C directory or your main OS partition.

[ad#In Post]

So if you never use hibernate, than its time for you to get your hard drive space back.

[Note: Hibernate mode is not sleep mode. When hibernating your computer completely shuts down, however, under sleep mode your PC is not completely shut down; it still consumes a small amount of power.]

The best way to delete hiberfil.sys or disable hibernate:

  • Go to Start menu, type “cmd” open up command prompt
  • Type “powercfg.exe -h off” [make sure you are an Administrator]
  • Type “exit”

RESTART YOUR PC and you are all set

After restart you should be able to see more free space on your hard drive.

Related posts:

  1. How to Disable Hibernation In Windows 8 To Gain Disk Space
  2. Hiberfil.sys in Windows 8 and Why You Should Never Disable Hibernation To Delete It
  3. How to Map Windows Live SkyDrive to Get Free 25GB Storage Space
  4. Shutting Down Windows 8
  5. Ubuntu One is Another Great File Sharing with 5G Free Cloud Space
  • Pingback: What is hiberfil.sys and how to delete in Windows 7 free up hard drive space | Jonathan Hu's Weblog

  • Pingback: What happened to my post? on Google Search result | Jonathan Hu's Weblog

  • joeletaxi

    Easiest way is to create a shortcut on the desktop as “powercfg.exe -h off” without the quotes then right click it and “Run As Administrator”.
    Job done

    • Phil

      Thanks! Great hint, I have been searching for this for the past three hours… It works too. I am useing the 64 bit Win 7 RC and couldn’t find anywhere to turn hibenation off.

  • Jeruvy

    Great tip I’ve been searching for 2.7 seconds and found this article. Thanks!

  • davidhankinson

    I get an error msg that I do not have permission to change hibernate. I am the administrator

  • Pingback: O que é o ficheiro hyberfil.sys no Windows, e como removê-lo? | Dicas de Internet

  • enyad

    I install Windows 7 Ultimate 64 on my laptop which was shipped with Vista Home Basic from manufacturer. I did all the necessary prerequisite checks prior to installing Win 7 and my computer is compatible. Did a custom installation, not upgrade. Everything seems to work fine…however when I right click on a file to use the built-in checksum feature of Windows Ultimate it does not come up. Instead, what i see is the menu items that were seen in Vista. I know it exists as I have used it on my desktop which is running Windows 7 Ultimate x64 as well.

    Can anyone tell me what the problem might be? Thanks in advance

  • http://www.pr-web.se/blog/ Per

    Works flawless! 10 seconds of work and I now have 3GB free. Word of advice, never install Windows 7 with a 20gb partition :) .

  • Pingback: Windows 7 - The Mega Sticky - Page 4 - Tactical Gamer

  • Kosh

    Wow, just freed up 5 gigs of disk space! Cheers! Now, how about pagefile.sys too? I know, it's virtual memory, but I've turned it off but pagefile.sys is still gobbling up 6 gigs of my disc space.

    • http://windows7hacker.com/ Jonathan

      yes pagefile.sys is for virtual memory. and its highly recommended to not to disable it even if you have lots of memory (say even you have 16GB or more memory)

  • Nick

    Worked like a charm thanx a lot

  • yanger

    say i want to backup my system with a tool like easeus todo backup.. in a pe envioronment, i can safely 0 byte the pagefile.sys, but hiberfil.sys, i can’t touch at all.. why is that? logic says if i’m backing it up, i could just script a powercfg.exe -h on at startup, but kinda ridiculous too… (0 byting it temporarily until it reboots, and system would restore it (at least, pagefile.sys gets restored immediately..)

  • sam

    thnx work like charm u are my hero

  • http://www.howtogeek.com/howto/windows-vista/run-a-command-as-administrator-from-the-windows-vista-run-box/ ganesh

    windows 7 user to delete by using run command with permission on alt+clr+enter ok…………
    enjoy and for seing

    its working not jock…………….

  • Nec-x

    Very Useful Thanx

  • MarkR

    Awesome, spent ages trying to reduce my Windows 7 Directory size! Many thanks!!

  • http://www.mobile-mobiles.net Mobile

    Thanks it helped on hard disk space

  • http://www.corneille.co.uk zifcorneille

    thanks your tricks have helped me save space on my hard disk

  • Sachin

    Thank you for the advice on getting rid of the hiberfil.sys. Have recovered 8GB on my 64GB SSD drive. :)

  • http://www.lightofvenus.com Diamond

    Many thanks!! Just restored ~3GB in my hospital’s desktop! Cheers.

    Dr. Barry Diamond

  • Petre

    Thanks. And How to turn it on again if needed?

    • mikeyJ

      apart from reading a little further up isnt it obvious? as powercfg -h off turns it off so powercfg -h on turns it on sheesh :-

  • sameer

    useful trick bt plz tell dat how to permanently delete hiberfil.sys bcoz when we switch on hibernate function by “powercfg -h on” same file reappears with same size and eat up the memory space

    • Waide

      Hiberfil.sys is that same size as your physical RAM, this is because it is an image of your RAM. If hibernation is turned on this file will always be there, because it is an image of your RAM. If you want to reduce the size of the file, remove some sticks of RAM.

  • mape

    I have a Windows7 x64 Professional.
    I went to the Start menu, right click on Command prompt -> Run as administrator. I typed “powercfg.exe -h off”. I restarted the computer but hiberfil.sys file wasn’t gone. I restarted my computer with my Windows7 boot disc and started the command prompt. I was able to delete the hiberfil.sys file. Hurray! But when I was restarted my cmputer and loged on Windows7, the hiberfil.sys file was there again. :(
    I tried the safe mode also, but it didn’t work.

    • Aj

       Proper use in my OS (Win7 Ultimate) is:


  • gestis

    joeletaxi, thanks a lot! Cool trick! Since SP1 installation, this file has allways been sitting in free space. Now I have “took care” of it. Yeees! :)

  • Pingback: 7 Ways to Reduce Your Disk Size in Windows 7 | Windows7hacker

  • deco

    Muito grato. Realmente funfou a dica do:

    July 11, 2009 at 2:02 am
    Easiest way is to create a shortcut on the desktop as “powercfg.exe -h off” without the quotes then right click it and “Run As Administrator”.
    Job done

    Agora como ativar pelo mesmo modo???

  • Chris

    Thanks a lot, works perfectly :o)

  • mani

    this cammad is not working in my system, so tell me the next step ..

  • Anotherfakename

    hiberfil.sys can be found in c:   using dir /AH /AS
    what I can’t do is delete it because it is in use. Switching hibernate off gets rid of it but hibernate on brings it back same size as before – thats a lot of disk

  • Sidesh_Rajput

    Great post - thanks very much. I found an article that works for Windows Vista, Windows 7 and Windows 8 also: 

  • Arturas

    Thanks, it work’s. :)

  • http://www.facebook.com/jamesvrude James Van Rude

    worked great, thanks
    (select run as administrator when opening command prompt, open using run ‘cmd’, then pin to start menu, then close, reopen with right-click, select run as admin; or navigate to cmd in accessories, i believe)

  • wm

    FYI: on my (german) Windows 7 it is “/h” and not “-”h” – worked fine with / though :)

  • Pingback: How to Disable Hibernation In Windows 8 To Gain Disk Space | Windows7hacker

  • http://www.facebook.com/4thchrenner Chuck Renner

    Thanks. I didn’t know about powercfg.exe. In older versions of Windows, I did this by turning on/off hibernation in the power control panel applet. Windows 7 doesn’t have that option. I didn’t want to permanently delete hiberfil.sys, but I did want to force the system to re-create it (so I also did powercfg -h on). I had upgraded my PC to 16 GB RAM, but my hiberfil.sys was still only 12 GB. Whenever my PC hibernated, it froze. When I turned hibernation back on, the new hiberfil.sys was only 12 GB again. I’ll cross my fingers.

  • Pingback: Hiberfil.sys in Windows 8 and Why You Shouldn’t Disable Hibernation To Delete It | Windows7hacker

  • Pingback: Enable Windows 8 Hibernate and See why its Better than in 7?

  • JAIREz

    it doesn’t appear that option when i right click, and I am the administrator

  • gbelletti

    Same problem. Looks like no one has an answer for it here.

  • Biggab

    Works fine with win 7 64bit: Go to Start and in the search bar type CMD but DONT PRESS ENTER. Right click on the CMD icon instead and choose ‘Run as administrator’. Type in the command and it should work. I got back 9 Gigs in under 10 seconds! Great!!

  • Abominog

    I was also unable to change the setting using the instructions in the article. Your tip worked excellent. I got 12GB back.

  • Nobody

    Click Start Menu, type “cmd” in the search box, hold down the Shift key and right-click cmd command. And choose Run as administrator from the context menu.