How-To

How to Use PowerShell to Enable or Disable Hibernation on Windows

Hibernation is a power-saving mode for your Windows PC. You might want an easy way to enable or disable hibernation on Windows. This guide explains how.

The hibernation mode on Windows is a power-saving option that offloads your current session to a local file (hiberfil.sys) to your hard drive and powers the PC off.

When you power on your PC again, the configuration of your session is loaded. You can resume your activities from where you left off.

However, the hiberfil.sys file can take up a lot of space on your drive. You may want to disable hibernation on Windows to turn the feature off and delete the file. Combining those options can only be done from the command line.

Here is what you need to know.

Using Hibernation Mode on Windows

The best time to enable and use hibernation mode is when you’re away from your PC for several hours or days. Otherwise, sleep mode will do just fine when you’re away for a few hours. Sleep mode offloads your session to RAM and allows you to get back to your session quicker than when using hibernation mode.

Plus, the hiberfil.sys file can take up gigabytes of space on your drive. If you have a low-capacity drive on your laptop, for example, you can turn hibernation off and delete the file using a single command. Another problem that can crop up is driver compatibility when using hibernation.

Turning off hibernation can help in those instances.

Note: Disabling hibernation in power settings on Windows only turns the feature off. You need to use the command line to turn it off and delete the file. Also, this works on both Windows 10 and 11.

How to Enable or Disable Hibernation on Windows

So, with a single command, you can turn hibernation mode off and delete hiberfil.sys. We’ll also show you the command to use when you want to re-enable the feature.

The steps below refer to using Windows PowerShell, but you can also run this command in PowerShell using the newer Windows Terminal app. Alternatively, you can also use the older command prompt to run it, too.

To enable or disable hibernation from PowerShell:

  1. Press the Windows key and type PowerShell.
  2. Select Run as Administrator from the right column.Enable or Disable Hibernation on Windows
  3. When the terminal opens, type the following command, and hit Enter:
    powercfg -h off

    Enable or Disable Hibernation on Windows

  4. After running the command, the hibernation feature is disabled, and the hiberfil.sys file is deleted. Note that there will be no confirmation notification.
  5. If you want to turn hibernation back on, open PowerShell as an administrator, type the following command, and hit Enter:
    powercfg.exe /hibernate on

Like turning hibernation off, there will be no confirmation message, but the feature will be re-enabled.

Using Power Features on Windows

If you want a one-stop place to enable or disable hibernation mode on Windows, the terminal is the place to go. You won’t need to navigate through a bunch of menus and power settings. In addition, using the command to disable hibernation mode disables it and deletes the associated file to save drive space.

Windows is full of other power settings you might want to check out. For example, you can enable power mode if your laptop is running too slow on battery power. If you have a new Windows 11 system, you can check your PC’s supported power features to see what you can configure. When your laptop is running low on power, learn to improve battery life on Windows 11.

If you want to tweak your system’s power options, check out how to create a custom power plan on Windows 11. Are you running Windows 10? Take a look at how to monitor app power usage. Also, you might want to learn about getting the most from your battery on Windows 10.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

 

To Top