How to Turn Off hiberfil.sys in Windows 7 (powercfg -h off)
Many people don’t use sleep mode, so they have no need for the usually huge hiberfil.sys file.
Sometimes the system drive starts running out of space, and this is a good place to free some up. But you can’t simply delete the file, because it is locked by the system.
I’ll show you how to get rid of hiberfil.sys easily and also turn off hibernation.
The hiberfil.sys file is located in the root of the system drive. The operating system creates it to support hibernation. When the computer goes into hibernation, Windows dumps the contents of RAM to the hard drive, and when it starts up, it loads that data back into memory.
How to delete hiberfil.sys
- Open Control Panel → Power Options → Change plan settings (the “Put the computer to sleep” setting).
- In the “Put the computer to sleep” drop-down list, select “Never” and save the changes.
- Open the Start menu, type cmd, right-click Command Prompt, and choose Run as administrator. Confirm the security prompt.
- Type the command powercfg -h off and press Enter.
powercfg -h off
After these simple steps, hibernation is turned off and the hiberfil.sys file is deleted automatically.
The same command works in Windows 8, 10, and 11 (there you can also write powercfg /hibernate off). To turn hibernation back on, run powercfg -h on.
Note that on Windows 10 and 11, turning off hibernation also disables Fast Startup, so the PC may boot a little slower.
