Simply command
rundll32.exe powrprof.dll,SetSuspendState
Does system hibernate, but if you write this:
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
And turn off hibernation with command:
powercfg -hibernate off
Now your system will go asleep, and will wake up on mouse move if selected a device for it (scroll down to learn how).
Batch a timer:
timeout /t 1200
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
Where 1200 is seconds, which mean after 20 minutes batch will run sleep command.
Optionally you can prevent canceling countdown (if you press any key in batch window):
timeout /t 1200 /nobreak
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
Little HOWTO about waking up with mouse:
Go to: Start -> Control Panel -> Mouse.
![alt text](../../I/static/images/c2a2cdc533c64d70498c0b3cf301f86553f680fd0d7802a9004aa278fcaa446e.png)
In the Mouse Properties window, click on the Hardware tab and select your mouse from the list of devices. Normally, there will only be one mouse listed here but that will depend on the hardware you have connected to your computer. When you have selected your mouse from the list, click the Properties button.
![alt text](../../I/static/images/f2297de33cb48248e5ffa7be76d81da703e23ebd345a0a5a8b6d88c4fe3eb7fa.png)
Now in the Properties window for your mouse, click on the Change Settings button on the General tab.
![alt text](../../I/static/images/293a7455158f7276ff80741fa77b737a3041f4fddeb90ee132a3629d887d4267.png)
In the window that opens, click the Power Management tab and check the option titled Allow This Device to Wake The Computer. Click the OK button on this window and click the OK button on the Mouse Properties windows that is still open.
From now on, you can wake up Windows 7 from sleep mode by clicking a mouse button or moving the mouse around.
![alt text](../../I/static/images/c4a0eff2348beaa6e709226dfa32d4c7672af13dd95707d323085e603e402165.png)
Just add a countdown part into the .bat and execute this after that. – Apache – 2010-05-26T07:30:51.787
looks like duplicate of http://superuser.com/questions/83437/hibernate-computer-from-command-line-on-windows-7
– akira – 2010-05-26T07:33:02.283Hibernation is totally diff, but yeah thats the correct solution I guess. – Apache – 2010-05-26T07:36:07.253
I believe the rundll thing is the same as hibernation. With sleep, you click the mouse and your login screen is there in a couple seconds... hibernation has to recheck the bios, harddrives, and transfer the saved state from the harddrive to ram and then boot windows. The only drawback to sleep is if you lose power and the saved state stored in ram is lost (and older pcs actually leave more components on like PSU and fans). – Saebin – 2010-05-26T07:43:42.530