I am trying to get rid of the hiberfil.sys file, with no luck.

I tried turning off hibernation in the Settings, with this guide

Turning off "Allow hybrid sleep" did not change anything. Windows doesn't remove the file, and I am not allowed to remove the file.

Typing the powercfg.exe -h off command also did not change anything. I get an error, Windows doesn't remove the file, and I am not allowed to remove the file.

C:\Users\Cogni>powercfg.exe -h off

Unable to perform operation.  An unexpected error (0x65b) has
occurred:  Function failed during execution.

I tried restarting the computer, still nothing works.

How do I fix this?

  • 12
    Based on my research you will only get that error if you attempt to run the command in a non-elevated command prompt as a user who isn't an Administrator
    – Ramhound
    Apr 25, 2017 at 11:18

5 Answers 5


Hibernating needs to be off, and only an administrator can change that setting. Then you need to restart to remove the OS's lock on the file, and after the restart, the file is gone.


Right click Command Prompt and then click Run as administrator. Or we could disable it through Control Panel\All Control Panel Items\Power Options\Edit Plan Settings\Change advanced power settings:

Disable Hinbernation

  • Such option is unavailable in my computer's Power Options. Why?
    – Incognito
    Dec 18, 2018 at 10:21
  • @Incognito I think hybrid sleep is a different thing. It's only available on desktop computers and is a combination of Sleep and Hibernation
    – golimar
    Jun 29, 2022 at 7:45

In most cases the actual reason of Unable to perform operation [...] Function failed during execution error is that being member of Administrators group is not enough. You have to intentionally run Command Prompt as Administrator.

When searching for "Command Prompt" from Start menu, select "Run as administrator" from the right side options. Click on it and when terminal window pops up - you should be able to see "Administrator: Command Prompt" in the window's title bar.

enter image description here

Enter the powercfg.exe -h off command again - now it should turn the hibernation off without 0x65b error.


A bit late I know but if you are wondering:

Open a command prompt as an admin and type powercfg /h on

And if you want to revert back: powercfg /h off

  • 2
    The question itself contains the command powercfg.exe -h off, and the two-year-old answer states that it must be done with administrator privileges,  so this doesn’t add any information. Apr 5, 2019 at 21:37
  • But the two-year old answer could be better formatted. It's easy to miss the fact that Joy specifically addresses the need to run cmd.exe as an administrator.
    – Luke
    Apr 22, 2020 at 1:09
  1. Open Control Panel.
  2. Search for power and open Power Options.
  3. Click on change plan settings
  4. Click on Change advanced power settings.
  5. Scroll down to Sleep and disable Allow Hybrid Sleep.
  6. Scroll down further to Battery and in Critical Battery Action put On Battery and Plugged in to sleep or something other than Hibernate.
  7. Open CMD as administrator and type powercfg.exe /hibernate off and hit enter.
  8. Now restart and hibernation file will be gone and some extra space on C drive will be available (3.1 GB in my case).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .