On Windows 10 I created a scheduled task to make a snapshot of C:\ each hour from 8:00 AM to 5:00 PM.
Works fine as long as the computer is running or stopped (not sleeping).

Problem : if the computer fall asleep during 8 AM - 5 PM, the scheduled task is fired when the computer wake up.
For example the computer fall asleep at 4:45 PM. It wake up at 9:15 PM, a snapshot is done, which is not desired.

How can I prevent the scheduled task to do its job outside the desired hours?

The task is exported there:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
          <Monday />
          <Tuesday />
          <Wednesday />
          <Thursday />
          <Friday />
    <Principal id="Author">
  <Actions Context="Author">
      <Arguments>shadowcopy call create Volume=C:\</Arguments>
  • Have you tried to set the DeleteExpiredTaskAfter value?
    – Robert
    Jan 8, 2020 at 13:34

3 Answers 3


it would be possible using PowerShell as the intermediary of executing the WMIC command.

Set the scheduled task to execute the powershell executable "powershell.exe" and pass the path to the location of the powershell script ".PS1" file as the argument.

Please see the below script that will pull the current time and execute the WMIC command if the time falls within the hours that you specify:

$StartHour = 8
$EndHour = 17

$DateTimeNow = Get-Date
If($DateTimeNow.Hour -ge $StartHour -and $DateTimeNow.Hour -le $EndHour){
    C:\Windows\System32\wbem\WMIC.exe shadowcopy call create Volume=C:\

You can change the hours using the variables $StartHour & $EndHour, I would suggest putting the hours in a 24 hour format.

Hopefully this helps!


On the settings tab of the task in Task Scheduler there is an option to "Run task as soon as possible after a scheduled task start is missed". Try unchecking that.

  • Already done. To be clear, I updated the question with an export of the task definition. Dec 28, 2019 at 19:05

This looks like an issue which has been reported several times, and, has yet, not been provided with a resolution on MS related forums.

In case you have not tried this before, attempt this workaround, if you think is suitable to your purpose. The explanation (for the workaround) makes sense. Keep a close eye on the drawbacks listed.

How to prevent scheduled tasks from running as soon as computer wakes up?

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.