On Windows machines, I know that it's possible to remove hiberfil.sys using via the command prompt so that a lot of space can be saved up on smaller drives (my hiberfil.sys is 25 gigabytes for some reason!). On desktop computers, there doesn't seem to be much risk in removing the file altogether. However, on laptops, I imagine things are different.

So if I have completely deleted this file from my Windows machine, what will happen if my battery depletes to the critical level? Will Windows attempt to hibernate even though hiberfil.sys is no longer present? If so, what will happen when it cannot find the file? Or will the machine just completely shut down altogether? I'm just curious.

  • If you delete or disable hibernate on a laptop then the laptop cannot hibernate. This means the laptop will go to sleep and/or simply turn off what happens entirely depends on what your configuration is set to – Ramhound Aug 17 '17 at 3:54

First, the size of hiberfil.sys defaults to 75% of the size of RAM (so I presume you have ~32 GB), but that proportion can be modified. Open a CMD prompt as Administrator and enter the size desired as a percentage of RAM, e.g.

powercfg -h -size 50

would reduce hiberfil.sys to ~16 GB.

Second, as long as Hibernate is enabled, you cannot easily delete hiberfil.sys, so I presume you've turned Hibernate off. Of course, Windows cannot hibernate, then.

The following two commands (which can be in a .bat file run as Administrator) turn Hibernate off, thereby automatically deleting hiberfil.sys, or on again, recreating the file..

powercfg -h off

powercfg -h on

You can use these three commands to resize or completely eliminate hiberfil.sys, with the trade-off that a reduced file might not have room to completely restore your PC's state after hibernation, and, obviously, when hibernation is disabled, the PC must do a slow, full, reboot when restarting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.