3

I'm trying to figure out how to get Windows 7 to sleep at 8pm and wake at 8am on a daily basis. I'm looking at Windows' services and there is a Shutdown.exe that can run, but it only seems to have a /h flag for hibernation. For waking from sleep, there is a "wake Windows from sleep to run this task" option, but it never seems to work. There is also a Sleep.exe program I can download but it comes with 13MB of other libraries from Microsoft.

Is there a C# program I can write to make this work?

bafromca
  • 143

2 Answers2

4

You can schedule a task at 8pm to run Rundll32.exe Powrprof.dll,SetSuspendState Sleep

You can then schedule some random task (like cmd /k echo wake up) at 8am and enable the "wake Windows to run this task" option.

Doug A.K.
  • 610
0

AFAIK wake-up is a pure BIOS feature, so if Windows 7 can't control this BIOS setting for whatever reason (e.g if the BIOS does not allows such a method to be configured externally), wake-up can only be set-up through the BIOS settings.

Lloeki
  • 266