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 > nul 
powercfg -h on

...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.

marked as duplicate by Dave M, Shekhar, Scott, Breakthrough, Excellll Aug 2 '13 at 18:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Not a duplicate, but searching for a user, who needs the command line for sleep. The most of the sleep commands are triggered by the external programs, but in XP, there doesnt seem to be only one-line command. – selnomeria-myopenid Aug 1 '13 at 11:56
  • Well I would see it as duplicate, as you would get the same answer as you can find that that question. – Jesper Jensen Aug 1 '13 at 12:01
  • @JesperJensen : seems to me that the asker clearly states that the one-line solution (which is the one given in the question you link) doesn't work for him. – Levans Aug 1 '13 at 12:08
  • @Levans It is also clearly stated in the duplicate topic and other answers has also been posted above. It's generally the same question, why should he get different answers? – Jesper Jensen Aug 1 '13 at 12:19

If you want to do it in “one line”, try

powercfg -h off & start /min "" C:\WINDOWS\System32\rundll32.exe PowrProf.dll,SetSuspendState 0,1,0 & ping -n 4 > nul & powercfg -h on

but I believe that the .bat file is easier.  :-)

Not the answer you're looking for? Browse other questions tagged or ask your own question.