1

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.

Dave M
  • 13,250
T.Todua
  • 4,053

1 Answers1

0

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

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