Skip to main content

Enable/Disable Windows hibernation on demand

Hibernation is a wonderful feature. Not only does it allow you to power-off your computer with all programs running and unsaved, it actually speeds up the process of switching ON and OFF your computer. However, one downside of hibernation is that Windows creates a hibernation file (HIBERFIL.SYS) on your C drive which is exactly equal to the size of the physical memory or RAM on your system. If you have 2GB of RAM, the hibernation file on your hard disk will be of 2GB. This 2GB is huge if you are low on disk space. The other downside of hibernation is that this HIBERFIL.SYS file is stuck on the C drive and there is no way of moving it to another partition or hard drive.

So the space occupied by that HIBERFIL.SYS is space wasted, a sort of, since you only require it at the time of hibernation.

To deal with this problem we will create a batch file, two actually, that will enable Windows hibernation only when you need to hibernate and then disable the hibernation file once you resume from hibernation.

Open Notepad and copy paste the following lines into it and save it with an extension CMD, like hibernate.CMD

powercfg /hibernate on
rundll32.exe PowrProf.dll, SetSuspendState

The first command will enable Windows hibernation. The second command will hibernate your computer. This CMD file will be your shortcut to hibernate your computer.

Now, we need to disable hibernation after the computer resumes from hibernation. Open Notepad again, copy paste the following line and save it with the CMD extension too, but with a different name, say disable_hibernation.CMD.

powercfg /hibernate off

This command will disable Windows hibernation. In order to run this file automatically after the computer resumes from hibernation, we will use a small tool called Hibernate Trigger. This program allows you to automatically launch application after the computer resumes from standby or hibernation. Now you just have to configure this program to run the second CMD file you created on resume.


Every time you want to hibernate, use the first CMD file you created to enable hibernation and then hibernate the computer. When you resume from hibernate, Hibernate Trigger will run the "powercfg /hibernate off" file and disable hibernation. Thanks Jim for the tip.


  1. The batch file will not execute the command to turn on hibernation when logged in as a user, and not a administrator.

    C:\powercfg -hibernate on
    You do not have permission to enable or disable the Hibernate feature.


Post a Comment

Popular posts from this blog

How to Record CPU and Memory Usage Over Time in Windows?

Whenever the computer is lagging or some application is taking too long to respond, we usually fire up task manager and look under the Performance tab or under Processes to check on processor utilization or the amount of free memory available. The task manager is ideal for real-time analysis of CPU and memory utilization. It even displays a short history of CPU utilization in the form of a graph. You get a small time-window, about 30 seconds or so, depending on how large the viewing area is.

Diagram 101: Different Types of Diagrams and When To Use Them

Diagrams are a great way to visualize information and convey meaning. The problem is that there’s too many different types of diagrams, so it can be hard to know which ones you should use in any given situation. To help you out, we’ve created this diagram that lays out the 7 most common types of diagrams and when they’re best used:

How to Schedule Changes to Your Facebook Page Cover Photo

Facebook’s current layout, the so called Timeline, features a prominent, large cover photo that some people are using in a lot of different creative ways. Timeline is also available for Facebook Pages that people can use to promote their website or business or event. Although you can change the cover photo as often as you like, it’s meant to be static – something which you design and leave it for at least a few weeks or months like a redesigned website. However, there are times when you may want to change the cover photo frequently and periodically to match event dates or some special promotion that you are running or plan to run. So, here is how you can do that.