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.

hibernate-trigger

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.

Comments

  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.

    ReplyDelete

Post a Comment

Popular posts from this blog

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.

69 alternatives to the default Facebook profile picture

If you have changed the default Facebook profile picture and uploaded your own, it’s fine. But if not, then why not replace that boring picture of the guy with a wisp of hair sticking out of his head with something different and funny?

How to remove watermark from an image or picture

A watermark is any recognizable text, logo or pattern that appears over an image to identify the owner of the image and generally used to prevent unauthorized reuse of the image. Watermarks are usually transparent and can be difficult to remove. The difficulty or ease of removal depends on the content of the image and the position, color, size etc of the watermark.