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 find out that there are two files called pagefile.sys and hiberfil.sys that occupy over few GB of your hard drive space. If you are the kind person that does not use Hibernate then this article is for you.
What is hiberfil.sys file for?
When you turn off your computer using hibernate, the operating system needs to store all your current running program states onto the 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 system root directory or your main OS partition.
So if you never use hibernate, then it’s time for you to get your hard drive space back.
Note: Hibernate mode is different from the sleep mode. When a computer is put in hibernation, it completely shuts down and consumes no power. However, when it’s in sleep mode, it still consumes a small amount of power. Since it’s not completely shut down, computers in sleep mode return to life usually are faster than the one from hibernation mode.
How to delete hiberfil.sys file?
The best way to delete hiberfil.sys is to disable hibernation in Windows:
- Go to Start menu, type “cmd” open up command prompt
- Type “powercfg.exe -h off” [make sure you are an Administrator]
- ENTER
- Type “exit”
- ENTER
RESTART YOUR PC and you are all set
After the restart, you should be able to see more free space on your hard drive.
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
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.
Great tip I’ve been searching for 2.7 seconds and found this article. Thanks!
I get an error msg that I do not have permission to change hibernate. I am the administrator
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
Works flawless! 10 seconds of work and I now have 3GB free. Word of advice, never install Windows 7 with a 20gb partition 🙂 .
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.
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)
Worked like a charm thanx a lot
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..)
thnx work like charm u are my hero
windows 7 user to delete by using run command with permission on alt+clr+enter ok…………
enjoy and for seing
its working not jock…………….
Very Useful Thanx
Awesome, spent ages trying to reduce my Windows 7 Directory size! Many thanks!!
Thank you for the advice on getting rid of the hiberfil.sys. Have recovered 8GB on my 64GB SSD drive. 🙂
Many thanks!! Just restored ~3GB in my hospital’s desktop! Cheers.
Dr. Barry Diamond
Thanks. And How to turn it on again if needed?
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 :-
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
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.
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.
Proper use in my OS (Win7 Ultimate) is:
POWERCFG.EXE H OFF
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! 🙂
Muito grato. Realmente funfou a dica do:
joeletaxisays:
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???
Thanks a lot, works perfectly :o)
this cammad is not working in my system, so tell me the next step ..
hey ,
open your command prompt with rus as administrator ..
right click on cmd then click on rus as administrator
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
Run the command and restart, duffus.
Great post – thanks very much. I found an article that works for Windows Vista, Windows 7 and Windows 8 also:
http://www.techfactor.org/2012/05/what-is-hiberfil-sys-and-how-to-delete-it/
please check your link
Thanks, it work’s. 🙂
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)
FYI: on my (german) Windows 7 it is “/h” and not “-“h” – worked fine with / though 🙂
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.
it says,
” you do not have permission to enable or disable the hibernate feature ”
now what i do ?
Make sure to run CMD as an administrator
Don’t delete in win7 when I type in cd then my pc replied that you are not ADMINISTRATOR
type cmd on runtab but do not clickenter move your mouse to the cmd app icon and right click >>>> run as admin
It worked. Cheers!
Thank you SOOOOOO much!!!!
Freed up a lot of missing room on a small SSD.
Freed 3gb! Thanks!
Thanks! Cleared me 5GB worth of space.
Thanks 5.5 gb freed
Of limited use, as it does not tell me how to “Make sure you are an administrator”.!! I have 26 gb tied up in hyberfil crap!! Now I need to go figure out how to get to CMD in the administrator mode.
from start menu, find the “command prompt”. Right click and “Run as administrator”.
Gave me back 2.83GB on a 250GB Seagate momentus 7200RPM hard drive
Did make the startup times(from powerup to desktop) faster for my win10 ssd laptops:
10 year old laptop startup time from 58 to 40 seconds.
5 year old laptop startup time from 35 t0 25 seconds.
Thank you very much, got my 12GB back, i never use hibernate function anyway