Gizmo's Freeware is Recruiting
We are looking for people with skills or interest in the following:
- Mobile Platform Reviews
- Rootkit Scanner and Remover
- Streaming Media Recorder
- Email Client
- Archive Manager Interested? Click here
How to Make Hibernation Work Better on Your PC
Many of us hibernate our PCs instead of turning them off. This provides a quick way to restart while using less power than the “Sleep” mode. This is particularly useful in laptops. Hibernation works by placing the contents of RAM in a hidden system file called “hiberfil.sys”. In Windows XP and Vista, this file is the same size as the amount of RAM that is installed on the PC. In Windows 7, the default is 75% of the RAM size. This file is always in the root of the drive with the Windows folder or normally the C: drive.
Deleting and restoring hiberfil.sys
It has become common to have a rather small volume for the C: system drive. It has also become common to have 4GB or more of RAM. This means that hiberfil.sys can take up a substantial portion of your system drive. If drive space becomes critical, you may wish to delete the hiberfil.sys file and turn off hibernation. Because hiberfil.sys is a super-hidden system file, the usual way to delete a file does not apply. However, there is a very simple way that uses the command line run as administrator.
Open a command prompt run as administrator and enter
powercfg –h off
That’s all there is to it. To restore the file enter
powercfg –h on
These changes take place right away
The command-line method is also useful for dealing with a corrupt or badly fragmented hiberfil.sys file. In the process of going in and out of hibernation many times, the file sometimes becomes corrupted. Deleting the file and then restoring it will clean up the file.
Changing the size of hiberfil.sys
If you wish to retain hibernation but want to reduce the size of hiberfil.sys, that can also be done in the command line. The file can be reduced to a smaller percentage of RAM with the command "powercfg –h -size <percent size>”. The command must be run as administrator. For example, to reduce hiberfil.sys to 50% of installed RAM, use
powercfg –h -size 50
Percent size cannot be smaller than 50.
Get your own favorite tip published! Know a neat tech tip or trick? Then why not have it published here and receive full credit? Click here to tell us your tip.
This tips section is maintained by Vic Laurie. Vic runs several websites with Windows how-to's and tutorials, including a computer education website and a site for learning about the command line.
Click here for more items like this. Better still, get Tech Tips delivered via your RSS feeder or alternatively, have the RSS feed sent as email direct to your in-box.
- Article type:
- Login or register to post comments
Printer-friendly version


Comments
I am running Win 7 64 bit . "Run as Administrator" even though I am logged on as Admin I still have to right click on the "Command Prompt" Icon in Accessories and select from the drop down menu "Run as Administrator"
Then this tip worked for me with /h /H or /hibernate
Hope this helps any who are having trouble with
Administrator Privileges
Windows 7 Pro x64
-h does not work
/h works
Thanks for the tip.
I created a shortcut for each of these commands so I can 'clean up' easily about once a week.
I have never had a desktop that hibernated successfully, or even slept with better than 50% chance of waking up without a fatal hangover. This is across 5 or so PCs, my two laptops do fine. Am I doing something wrong? I haven't ever adjusted anything, just tried sleeping/hibernating automatically. So I've always gotten rid of that file, it wasn't of any use.
powercfg –h off had to use powercfg –H off
On Windows 7 x64 using -h just got the msg about not finding the command. Using the help /? shows it has capital -H on:off so tried that. Happens in a flash, no msg so guess it took since returned to command line in user folder of command prompt run as Admin.
I tried this tip with both lower case "h" and upper case "H" and neither one worked on my floortop computer (Win7 Ultimate X64).
My laptop, with Win7 Home Premium X64, hibernates just fine right-out-of-the-box!
I'm stumped! (I've also resigned myself to "Sleep" mode on my floortop, although that's seldom necessary since it's on-line 24/7)
Karl
On Windows 7 x64 using -h works just fine for me. It is rare that a command is case sensitive.
I find that my Vista laptop requires the full hibernate command
powercfg /hibernate on
-h doesn't work here:
You may need to run the cmd prompt as administrator.
It should be noted that not all systems support hibernation. This is particularly true of desktops and older machines.
Oh, it should be noted.....thanks?
Once done how do you know if you are successful or even if the effort has made any difference. The brief moment the black input screen pops up is little indication. The powercfg/?....does the same, the black screen appears and is gone in a second. I even ventured through the "super hidden" link on this page where the command there (dir C:\ /as) renders an error result "dir" cannot be found etc. I am running XP Pro and it would great to see what you've suggested is actually taking place and to be able to see the difference.
Bring up a command windows (cmd) and then initiate the command. You may want to pipe the output through the MORE filter, especially if you list the help (powercfg /?|MORE)
I get the impression that some people may have confused running a program as administrator with being logged into an administrator account. Being in an administrator account is not sufficient. See this previous tip- http://www.techsupportalert.com/content/quick-ways-open-windows-vista7-c...
By turning of the hibernation file how much space do you gain on your hardrive?
As explained in the tip, it is a function of how much RAM you have.
Doesn't work with me. Required "/?" always.
@ unsteadyken, thanks for your tip. It works now:
powercfg -hibernate off
Win7
I had a need to do this a while back and after entering powercfg –h on i still couldn't see the hibernate option so i had to go in to Power Options in the control panel click on the link “Change when the computer sleeps” and then open the link “Change advanced power settings” then Under the Advanced Sleep options, expand the Sleep tree and turn off Allow hybrid sleep.
showed up after that
I tried the article's tip on my Win7 Ultimate X64 opsys, and it didn't work either (I was logged in as Admin, too!). I then tried Knookie's tip (above) and I STILL can't get the "Hibernate" option to show up in my Shutdown options!
Am I missing something? (Probably) Any further guidance or suggestions?
Karl
Hi Karl K, try 'unsteadyken' tip [Post (89393)]. It worked to me.
powercfg -hibernate off
powercfg -hibernate on
Many thanks, Kubo. I will try that. I tried the ALL CAPS tip, but that didn't help at all.
Karl
@ glofp-dk
Same with my system, you must use capital letters for this to work.
Ah-ha! I'll try it again, but using ALL CAPS for the entry! I'll advise results shortly.
Karl
NOPE! I logged in as Administrator (as in the original tip) and then entered the change in ALL CAPS.
The "Hibernate" option STILL doesn't show up in my Win7 Ultimate X64 system!
Karl
I tryed setting the powercfg on/off, but on my PC it only works witk capital letters - this is also described in the /? help file in command prompt
Does the size trick only work on Windows 7?
r2,
You can test that easily by opening the command prompt and running
powercfg /?
There are SIGNIFICANT differences between what it shows in Win7 and in my (virtual!) XP.
Virtual machines do not have the same features as a regular setup.