I am trying to make a my laptop wake from sleep and then go back to sleep after a few moments.

To wake the PC I scheduled a cmd.exe with the argument /c exit and it works fine.

To sleep I use a bat file with the following lines:

ping -n 15 > nul 
Rundll32.exe Powrprof.dll,SetSuspendState Sleep

The ping is to both a 15 second delay.

Both of these work individually but when combined it doesn't work correctly. When the PC is asleep I see it wake, although the screen remains off and then after the 15 second delay it doesn't go back to sleep.

What am I doing wrong if I want to take a sleeping PC, wake it for 15 seconds and then go back to sleep?

Thanks in advance.

  • Are you combining in a single BAT file. I suggest create 2 BAT Files one each for stating cmd.exe and next for ping and sleep commands. Then in third BAT file put START command followed by /WAIT to trigget each BAT file one after another. See if this helps. To wake the monitor you can use freeware called NirCMD nirsoft.net/utils/nircmd.html – patkim May 20 '19 at 22:35
  • The wake function and the sleep function are different from entries but I will try your way and get back to you – DonnellyOverflow May 20 '19 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.