5

I sometimes need to run a batch job on my Win 7 Pro workstation at a fixed time. I use the scheduler to make sure the task runs then. But, I need to disable sleep beforehand, which wastes lots of power.

To keep things green, how can I tell my PC to awaken from sleep at 3 and go back to sleep at 3:30?

2 Answers 2

3

If you pop open Task Scheduler and click Create Task, there's a check box under the Conditions tab that will wake the computer to run the task:

enter image description here

You could run your batch job from there, and create another task to put the PC back to sleep, or run the shutdown command in your batch job after it finishes (as long as there's a way to tell it has finished.)

There's a few ways to put the computer back to sleep detailed in this question; I like the PsShutdown option the best (psshutdown -d -t 0).

4
  • Super! Any way to do that from the command line? Jul 9, 2014 at 18:34
  • Do what? Create the scheduled task? I believe that's a PowerShell 4.0 only thing: technet.microsoft.com/en-us/library/jj649816.aspx and it's slightly daunting IMO.
    – rtf
    Jul 9, 2014 at 18:35
  • @Tanner the Task Scheduler does have a pretty good GUI, it's definitely not a PowerShell-only thing. What? How can you ask this question after posting a valid answer?
    – Daniel F
    Jul 11, 2014 at 15:00
  • @DanielF. PowerShell 4.0. As in, only installed by default on Windows 8.1 and Server 2012 R2. If you're on Windows 7 you'll need to install WMF 4.0.
    – rtf
    Jul 11, 2014 at 15:22
1

In addition to the answer suggesting the use of the Task Scheduler, which may be the best option to use, here are two other things to consider for switching on the computer:

Some BIOS have an option to turn the PC on at scheduled times

  • pro: windows doesn't have to sleep, can be fully shut down. (if it turns out that the Task Scheduler can only handle it's task if Windows has been set to sleep).
  • cons: If you want to disable it for one day or edit the time you'll have to enter the BIOS

Use another computer like a Raspberry Py to send a WOL (wake on lan) packet to the machine.

  • pro: windows doesn't have to sleep, can be fully shut down. the other computer can also be used to monitor that machine, ie via SNMP and for other stuff.
  • cons: uses extra power (about 3.5 watts for a raspberry py)

You must log in to answer this question.

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