If you're interested in downloading AutoHotkey, a free hotkey tool, you can use a script that will put your PC to sleep.
I've been using AutoHotkey on my Desktop PC and Laptop PC's (both Win 7 x64) for about 3 years. It's a nice tool that I use to define keys and run various scripts.
I have a script that should do what you're interested in:
Code:
Sleep 5000 ; comment: Not a "Sleep" standby command. This is just a "wait" command within the script
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
Exit
You can write a similar batch file for CMD but I found that it was easier for me to use the AutoHotkey DLLCALL since I'm using it anyway on both PC's.
You can also define a hotkey for Sleep mode. The following line in my startup AutoHotkey script defines the key combination <win>s to put the PC into Sleep mode (Standby). I have Hibernation disabled on my Desktop PC.
Code:
#s::DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
If you decide to use AutoHotkey on your PC, you can then create a task in Task Scheduler to run the script.
I have another script that I use to invoke Sleep unattended after a daily backup program completes. It runs with Task Scheduler at a time during the day when I'm rarely at the PC but if I am in an interactive session at that time, the script begins with a 4-count loop and plays one of the Windows media *.wav files, to let me know that the Sleep task has launched.
Then the script will play one of my .wav music tunes for a couple of minutes, then fade out like a tune on a radio. If I want to remain on my PC, I can just run Process Explorer or Task Manager and delete the process to prevent the PC from going into Sleep mode.
Here's my Sleep script:
Code:
SoundSet, 100
Loop, 4
{
SoundPlay, C:\Windows\Media\Afternoon\Windows Notify.wav, wait
}
SoundSet, 60
SoundPlay, C:\Users\Jeff\Documents\Music\WAV FILES\my_tune.wav
Sleep 120000
Loop, 70
{
SoundSet, -1
Sleep 375
}
Sleep 2000
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
Sleep 5000 ; Keeps sound off for 5 sec after wakeup to mute residual wav output
SoundSet, 100
Exit