How to Disable Hibernation on Windows Vista

Hibernation is a feature introduced in Windows 2000 and later in Windows XP which allows your computer to enter a sort of "deep sleep" mode - your computer's state is preserved, and it uses far less power than if you just put your computer into Standby mode. But in order to enable your system to Hibernate, Windows reserves a hidden file (c:\hiberfil.sys) which is roughly equal in size to the amount of RAM your system has. Hence if you have 2GB of RAM in your system, then you'll have a corresponding hiberfil.sys file which is roughly 2GB in size. This is perfectly fine and harmless if you plan on using the Hibernation feature and you have plenty of hard disk space to spare. On my desktop machine, however, I don't plan on using the Hibernation feature (since this system is always on as a server/workstation) and my drive space is at a premium.

Disabling the Hibernation feature in Windows XP was fairly straightforward using the Power Options in the Control Panel. It's a bit trickier in Windows Vista, though, since there's no graphical way of disabling this via the Control Panel. (Or if there is, I certainly didn't find it!)

Luckily, though, Hibernation is easy enough to disable via the command line. Here's how:
1) Click Start (or the Windows Logo) -> All Programs -> Accessories.
2) In this folder you will see an entry labeled Command Prompt. Right-click this entry and select "Run as administrator."
3) At the command prompt, type "powercfg -h off" (without the quotes) and press Enter.
4) Unfortunately there's no confirmation message to indicate whether or not you were successful. But we can confirm this for ourselves by typing "dir /a:h c:\hiberfil.sys" (again, without the quotes) and pressing Enter. If we were successful then you should get a message which says "File Not Found."
5) Voila! We have just disabled Hibernation and freed up some disk space. But if you decide that you want to enable Hibernation later you can do so by following steps 1-3 again, but this time specify "on" instead of "off" during step 3.

Note: If you get a User Account Control dialog during any of the above steps you can simply click Continue.