There's an entire SU question regarding shutting down/sleeping the computer from the command-line, so I won't bother repeating that info here again:
How can I put the computer to sleep from Command Prompt/Run menu?
For waking the computer:
Unlike what @Phoshi seems to suggest in his answer (from 2011), with Vista+ you can use Task Scheduler to wake up the computer from sleep.
Look under the Conditions Tab for your task:
Basically create a task, set the time you want to wake the computer, and then set it to run a program, with the "Wake the computer to run this task" enabled. For example, running cmd.exe
with /c exit
as the arguments will cause the CMD to be launched, and then exit
is immediately run to close the CMD window.
More info: How to Make Your PC Wake From Sleep Automatically