0

cmd' file to put my computer to sleep:

rundll32.exe powrprof.dll,SetSuspendState 0,1,0

If I run the 'sleep.cmd' file the computer goes to sleep and I can wake it up by pressing a key on the keyboard or clicking the mouse.

BUT: Wake Timers do not work anymore: enter image description here

If I put the computer to sleep with 'start menu -> Power -> Sleep ' then the same wake timer I set with the Windows Task Scheduler works.

Does someone know if I have to change my command in the 'sleep.cmd' file or if I can add another command that I am maybe missing that also wake timers can wake up ?

WAKE ON LAN works with both ways ( 'sleep' Button in StartMenu and 'sleep.cmd' file )

1 Answer 1

0

Ok I can answer my own question:

With the PsShutdown utility it works !

Just Download PsTools (microsoft sysinternals) extract and add the target extraction folder to your windows 'PATH' variable.

Then you have to run your target sleep.cmd script as administrator, call the PsShutdown executable (that is in your path variable or use an absolute folder path ) and it works:

  • -d => Suspend the computer
  • -t => 0 seconds until computer gets suspended

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .