How can Windows 7 be set to sleep at 8pm and wake at 8am every day?

07
2013-09
  • bafromca

    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?

  • Answers
  • Doug A.K.

    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.

  • Lloeki

    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.


  • Related Question

    Windows doesn't wake up from sleep reliably when bluetooth is on
  • mika

    This issue has bugged me on multiple laptops for at least three years now, and I was wondering if anyone had similar experiences.

    The problem is that waking up from sleep results in a hang or BSOD, but only if bluetooth is enabled. This does not happen every time, but often enough that you have to be careful before using sleep mode at all.

    I think the most probable cause is the Windows driver (BTHUSB.SYS) for the particular bluetooth adapters i'm using, so I must specify the systems a little more. In both machines there has been BTHUSB errors in the Windows event log, but even these don't show up always.

    Apple MacBook (first generation)

    • Intel 945GM chipset (for Core Duo, not Core Duo 2)
    • "Built-in Bluetooth 2.0 + Enhanced Data Rate (EDR)"
    • Windows XP, Microsoft Bluetooth Driver (BTHUSB.SYS)
    • wakeup never crashes in MacOS, only in Windows
    • I don't know how you disable bluetooth in BIOS, so haven't tested without
    • sometimes just bluetooth goes down but Windows stays up

    Dell Latitude D380

    • Intel GM965 chipset
    • Dell Wireless 360 Bluetooth Module
    • Vista x64, Windows 7 x64, Microsoft Bluetooth Driver (BTHUSB.SYS)
    • wake-up from sleep works reliably if I disable bluetooth in BIOS
    • No error messages in event log (Windows 7)

    I don't expect that this can be solved, but I'd like to know what machines to avoid in the future. It was really a surprise that the Dell had the exact same problem as the older MacBook.


  • Related Answers
  • 8088

    Sleep problems occur again and again on this forum.
    This is a retake of my answer for thread 23820.

    Ideas for resolving not coming out of sleep:

    1. Look in your BIOS for the suspend ACPI options and try to switch modes among "S1 and S3", "S1", "S3" etc.
    2. Ensure "Allow this device to wake computer" is checked in in "Device Manager/$device$/ Properties/Power Management", where $device$ stands for keyboard and mouse.
    3. Turn off Hybrid sleep, see explanation here (for vista, but is the same)
    4. The hibernation file is sometimes disabled by disk cleaning, to restore do in cmd run as administrator "powercfg -h on".

    Note: Any of the above manipulation that doesn't help should be undone.
    Item 1 was the one that worked the last time this question was asked.

    In Windows 7 one can use the following command to troubleshoot sleep problems and return a detailed report:

    powercfg -ENERGY

    image

  • mika

    I was wrong.

    The problem with Dell Latitude D380 was a broken DDR2 SO-DIMM module, and had nothing to do with bluetooth.

    Replacing the memory fixed the issue. But I figured this out only after the machine started to give memory errors during the boot process.