From C# program I want to call windows command prompt and make the system to sleep and after few seconds I should wake the system. I am successful in making the system sleep but I can't wake it up after few seconds. The command that I tried for making it sleep and wake up is "powrprof.dll,SetSuspendState 0,1,0 && timeout 10 && echo "Hello World" ".
The link http://www.groovypost.com/howto/schedule-wake-sleep-windows-automatically/ says echo will wake the system but its not working.
It is possible using the win32 CreateWaitableTimer API.
For running the above script call wakeupWindows.py from console like:
Will set the wake up timer to 2 minutes from now. The script will wait for 2 + 1 = 3 minutes. From another console put the system off to sleep using:
After 2 minutes, the system will wake up from sleep.
Similar implementations are possible using C# or this script can be converted to an exe using pyinstaller as explained here.