This question already has an answer here:
I wanted to know how to standby (sleep) from command prompt for Windows XP. Using this CMD command
C:\WINDOWS\System32\rundll32.exe PowrProf.dll,SetSuspendState 0,1,0 didn't work alone.
The only way I have found is to make a .bat file, then insert this code:
powercfg -h off start /min "" C:\WINDOWS\System32\rundll32.exe PowrProf.dll,SetSuspendState 0,1,0 :: waiting 4 seconds for sleep ping -n 4 127.0.0.1 > nul powercfg -h on exit
...and whenever I open that file, the computer sleeps.
Is there an easier way to do this? I don't want external programs, just from cmd.