

Rundll32.exe Powrprof.dll,SetSuspendState SleepĬlick File –> Save As, Under Save as type, choose All files *.* and give your file a name like sleep.bat (or something else with a. To create a sleep batch file open up Notepad and type the following: By using a batch file, you can add other parameters and commands to it later without rejiggering your Windows Task Scheduler task. The way we’ll put your computer to sleep is by running a script (.bat) that will initiate the sleep command. How to Create a Batch (.bat) File to Put Your Computer to Sleep Sleep, read this write-up that Austin did on the subject: Understanding Your PC And Devices, Sleep VS. Mission accomplished.įor more information on Hibernation vs.

Now, like a bear addicted to espresso, your computer will no longer hibernate. If you get the error message: “You do not have permission to enable or disable the Hibernate feature” then re-read the previous step about running cmd.exe as an administrator. If the command was successful, then you’ll get no error messages. To do this in Windows 7, click the Start button, type Cmd and then right-click cmd.exe and choose Run as administrator. Open a command prompt as an administrator. If you have similar problems, you might just want to disable hibernation/hybrid sleep altogether. In my case, waking from hibernation from a script only half worked-the computer would turn on, the fans would spin, and I’d get stuck on the “Resuming Windows” screen forever. This is so you won’t lose anything in case of a power outage.īut the real issue is that sometimes, hybrid sleep/hibernation can interfere with an automated wake script, depending on your configuration. Hybrid sleep does both-it saves open documents and application states into the memory and the hard disk.

This is important for laptops with batteries, but not so much for desktops. Hibernate is a power-saving feature that saves your machine’s state (including unsaved documents, program states, etc.) onto your primary hard disk instead of onto the RAM (as sleep does.) The tradeoff is slower resume time, but less power draw. The first step is to disable hybrid sleep and/or hibernation on your computer. How to Disable Hybrid Sleep/Hibernation in Windows
