Hibernation and Sleep in Windows

Back to Articles

Hibernation and Sleep in Windows

Computers and the devices connected to them can consume an ample amount of electricity. That’s why Windows comes equipped with  ‘powercfg’, the power configuration tool.  PowerCFG allows Windows to monitor many aspects of your computer’s system performance and its energy usage. It also manages power consumption variables for internal computer components along with how your active data and working sessions will be affected by them. With the help of this tool, Windows establishes multiple ‘power plans’ with every installation. They provide independent settings for when you’re on battery power and for when you’re plugged into an outlet. Your power plan comes pre-configured for general use. But  you can enable, disable and modify many of its functions to suit your needs or preference. Two of the most important and beneficial features available in your power plan are ‘hibernation’ and ‘sleep’.  These two functions are called ‘sleep states’.

*Got It. So What Are Sleep States and What Purpose Do They Serve?

They are power/electricity conserving features, but they serve additional purposes as well. If you care about preserving energy and your data, these tools are your best friends. They help your computer be easy as possible on the energy consumption without interfering with it’s activity. This empowers you to minimize unnecessary energy consumption intelligently when your system is not in use, without losing your current session. Although (in this article) we’ll be focusing on these two states in particular,  there are other sleep states as well, including ‘Fast Startup’ and various ‘Standby’ modes. Not all of them are available on every system and there are reasons to use certain ones and reasons not to use any of them at all.

*Which Sleep States Are Available On My PC?

Let’s find out.

Here’s how you can check the supported sleep states on your system. Both the ‘Command Prompt’ and ‘Windows PowerShell’ can handle this task.

1. Type the name of whichever app you want to use in the start menu. (‘Command Prompt’ or ‘Windows PowerShell’)

2. When the requested app appears, right-click it and select ‘Run As Administrator’.

**If you get a user account prompt, make sure you allow it.

 

3. Once you’re in as admin, type either one of these commands, then hit ENTER:

powercfg /AvailableSleepStates

powercfg /a

It should reply with a message starting like this:

The following sleep states are available on this system:

It will list all sleeps states available to you on your machine and those that are not…

**If you see Hibernation in this list, then it is surely available on your system.  If you can’t find it as an option in any user menu and the Hiberfile is missing, it’s likely just disabled. Jump HERE to learn more.

*Nice. I'd Love To Save Energy And Keep My Work Untouched As Well. But Which State Should I Choose?

Well, that’s for you to decide. But it depends on how you are using your system and what you need done. You can’t just arbitrarily select a sleep state. But (as kinda mentioned before) in Windows, the two most generally familiar and widely used states are ‘Hibernate’ and ‘Sleep’. And for good reason. Which is why we are focused on these two states for this particular guide.

*I See. So What's The Difference Between Sleep And Hibernate In Windows?

Great question! We’ll cover the basics.

Your current computer session will remain intact in RAM, where it already is. This includes all open windows, running applications, etc. Windows puts to sleep any components that are not needed or being used, including the hard drive. Your computer stays on but goes into a low power state with active RAM. When you are ready to get back to business, the system will wake up from its slumber quickly and your session will resume exactly as you left it. It should anyway. 🙂

Your current computer session, in its exact state, will be copied from RAM and saved to the hard drive as a single hidden system file named ‘hiberfil.sys’. Your computer will be shut down completely. The next time you start the PC, Windows will read the saved file and restore everything back to RAM, as it was. It may take a bit longer to restore your session since everything is being read from the hard drive, which typically has slower read, write and transfer speeds than RAM does. When it’s done, you’ll be looking at the exact same screen you were looking at before hibernating. You can continue where you left off without a hitch or hiccup, if all is working correctly.

*So How Do I Use These Sleep States?

It’s ultra simple! You hardly even ‘use’ these states. Windows does most of the work on it’s own. You just gotta make a selection.

To activate either sleep state:

1. Click the Start Menu.

2. Hit the Power Icon. A sub menu will pop up with various power choices.

 

3. Simply select which power state you’d like to apply.

That’s it!

**You can activate either Hibernation or Sleep mode by selecting one of them from the Start Menu’s power options, as described above.

However, they can also be set to activate automatically after a specified time of inactivity. You can quickly set the timer from the Power Options window.

*Cool. So How Do I Configure The Setting For Sleep Mode?

Windows provides preset times to schedule the activation of sleep mode.

If you need more control, you can set your own custom time.

Use one of the methods below to suit your needs.

**You can also turn the timer feature off all together, using either method.

To quickly change the settings with preset time options follow these steps.

1. Type or paste the path below into an Explorer window and hit enter.

Control Panel\All Control Panel Items\Power Options\

 

2. Select ‘Change Plan Settings’ next to your currently active power plan.

 

3. Hit one of the dropdowns next to ‘Put the computer to sleep’ and choose a preset time.

**Choose ‘Never’ to disable the feature.

4. Save the changes.

****If you have set any custom times in the past, the most recent one will show up as a select-able option in the list with the presets.

If you need to set your own custom time instead of choosing one of the presets use this method.

1. Type or paste the path below into an Explorer window and hit ENTER.

Control Panel\All Control Panel Items\Power Options\

 

2. Select ‘Change Plan Settings’ next to your currently active power plan.

 

3. Select ‘Change advanced power settings’.

 

4. Expand the ‘Sleep’ category.

5. Expand the ‘Sleep after’ category.

6. Click either of the settings to set the sleep timer to your liking.

**Input the number 0 or the word ‘Never’ to disable the sleep function.

7. Hit Apply, then OK to close the power options window.

****Windows keeps a reserved parking spot in the preset list just for you. How sweet. Your most recently set custom time will be added to the preset drop-down list for quick access in the future. 🙂

*OK, Cool. So How Do I Configure The Setting For Hibernation Mode?

We already showed you how to manually activate hibernation from the Start Menu, using the steps mentioned above…

But, you can make it activate automatically after a certain amount of inactive time. You can also prevent it from auto activating as well.

Here’s how to do either.

1. Type or paste the path below into an Explorer window and hit ENTER.

Control Panel\All Control Panel Items\Power Options\

 

2. Select ‘Change Plan Settings’ next to your currently active power plan.

 

3. Select ‘Change advanced power settings’.

 

4. Expand the ‘Sleep’ category.

5. Expand the ‘Hibernate after’ category.

6. Click either of the settings to set the hibernation timer to your liking.

**Input the number 0 or the word ‘Never’ to disable the hibernation function.

7. Hit Apply, then OK to close the power options window.

****Disabling it from here only addresses the automatic timer settings. It will NOT delete Hiberfil.sys, located at the root of your C: partition. You must use Command Prompt or Windows PowerShell to completely disable hibernation. Doing so will delete the hiberfile and remove all hibernation options from all user menus.

*You Keep Mentioning This Magical Hibernation File. What Else Can You Tell Me About It?

As mentioned before, there is a system file that is saved to the hard drive. When hibernation mode is engaged, this is where the contents of your current session gets saved.. It is named ‘Hiberfil’, and has the extension .sys. By default, this file is located at the root of your C drive, where Windows is installed.

C:/Hiberfil.sys

Since it is an important system file, It is not visible in Explorer by default. If you don’t see it, make sure you show hidden files in the Explorer Folder Options before worrying (about it going unintentionally missing) or assuming (that you have properly deleted it). If you don’t know how to show and hide system files in Windows, learn how to do that HERE.

Anyway, this file can range in size greatly. It can be as small as a few gigs or larger than 20GB. It depends on the amount of RAM you have and the amount of content that needs to be saved from your session. There are ways to shrink the size of this file, but doing so may cause errors and blue screens if it is not large enough to properly save your entire session. I wouldn’t bother. But I would disable hibernation completely if I wanted or needed to. If you understand the function of the hibernation feature, but don’t intend to use it, this file is useless. In such a case, you can free up some hard drive space by deleting it.

*I Tried To Delete The Hibernation File But Windows Wouldn't Let Me. What Gives?

As mentioned, Hiberfil is a protected system file. Because of this, it is hidden from view by default and its user permissions give only Windows the clearance to modify and delete it. Plus it is always running in the background, ready to be engaged. And you can’t delete files that are currently in use. So it can’t be deleted by the user in any typical fashion.  If you won’t be using the hibernation feature and want to give your HD some extra room to breathe, use one of the OFF commands below. They allow you to completely disable the hibernation feature in Windows. The commands to re-enable it are given as well.

**When using the OFF commands to disable the feature, Windows will respect your choice and automatically delete Hiberfil.sys for you. We love you Windows 🙂 …When you work right.

Remember, you can use either the ‘Command Prompt’ or ‘Windows PowerShell’ to input these commands

1. In the start menu, type the name of whichever app you want to use for this task.

2. When the requested app appears, right-click it and select ‘Run As Administrator’.

**If you get a user account prompt, make sure you allow it.

 

3. Once you’re in as admin, type either one of these commands and press ENTER:

powercfg -h on

powercfg /hibernate on

 

If Hibernation is turned on successfully, you’ll find the Hiberfil.sys file at the root of C: drive, where Windows is installed. Simple.

powercfg -h off

powercfg /hibernate off

 

If Hibernation is turned off successfully, you’ll notice that the Hiberfil.sys file does not exist at the root of your C: drive, where Windows is installed. Simple.

The option will be removed from all the sleep menus that are visible to the user as well. So you won’t see it anywhere when choosing or configuring sleep states.

4. You won’t get any special confirmation. The prompt will respond with the directory, awaiting your next command.

There’s no need to restart or anything. The changes take effect immediately. Thanks to whomever programmed the behavior of the Hibernation feature in Windows. Shawty you da best!

You can find the file here: C:/Hiberfile.sys

**The best way to tell if the commands worked is to check to see if  hiberfil.sys exists or not. Remember, important system files like this are hidden by default in Windows. You must first reveal them by modifying Explorer’s settings, like THIS.

In general, if there is no Hiberfile, Hibernation is off. If the file exists, it’s on. Simple.

****Sound good. These Functions Are Quite Intricate, Well Thought Out and Very Useful. I'd like to learn more. I'm ready to go to the next level with PowerCFG!

You are definitely correct! And there are so many more things you can do with PowerCFG to manage crucial power related functions and features like the ones in this article.

If you wanna level up and handle Windows like an Innovator, click HERE to start the next article and find out what else PowerCFG can do!

Oh and remember. Avoid engaging in acts of greed, carelessness or selfishness. Preserve energy and use it wisely. Don’t abuse power. They must be used to create and serve positivity and progress…

INNOVATE!

Leave a Reply

Your email address will NOT be published. Required fields are marked with an *

Back to Articles