none
Windows 8 Task Scheduler will not run "At system startup" task

    Question

  • I have moved to Windows 8 from XP where "on startup" tasks worked fine.
    In Windows 8 I can't for the life of me get one to run. I add it through the UI and have Enable Tasks History set, but it never runs and there are no errors in the Event Log.
    The task is (for now) just to run a test .bat script, and is defined as:

    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
      <RegistrationInfo>
        <Date>2013-01-05T11:04:13.4996188</Date>
        <Author>JCPR-Dell-3\peter</Author>
      </RegistrationInfo>
      <Triggers>
        <BootTrigger>
          <Enabled>true</Enabled>
          <Delay>PT10S</Delay>
        </BootTrigger>
      </Triggers>
      <Principals>
        <Principal id="Author">
          <RunLevel>HighestAvailable</RunLevel>
          <UserId>S-1-5-18</UserId>
        </Principal>
      </Principals>
      <Settings>
        <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
        <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
        <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
        <AllowHardTerminate>true</AllowHardTerminate>
        <StartWhenAvailable>false</StartWhenAvailable>
        <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
        <IdleSettings>
          <StopOnIdleEnd>true</StopOnIdleEnd>
          <RestartOnIdle>false</RestartOnIdle>
        </IdleSettings>
        <AllowStartOnDemand>true</AllowStartOnDemand>
        <Enabled>true</Enabled>
        <Hidden>false</Hidden>
        <RunOnlyIfIdle>false</RunOnlyIfIdle>
        <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
        <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
        <WakeToRun>false</WakeToRun>
        <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
        <Priority>7</Priority>
      </Settings>
      <Actions Context="Author">
        <Exec>
          <Command>cmd</Command>
          <Arguments>/c E:\utils\cy-test.bat arg1 arg2</Arguments>
        </Exec>
      </Actions>
    </Task>

    The scheduler task is running (other tasks run and show history).

    I have tried without and with the "<Delay>PT10S</Delay>".

    What on earth is (not) going on?


    Saturday, January 5, 2013 9:40 PM

Answers

  • Problem solved. It is caused by "shutdown" no longer meaning that!

    My environment is a PC that is shut down every day and started the next.
    The "At System startup task" is a constantly-running process (actually a CygWin script) for various housekeeping tasks. Its logic assumes it is run once on each system start-up.

    But, by default when you shutdown this PC-hostile Operating System it doesn't.

    It goes into some semi-hibernate mode and the startup task is never fully "killed", despite its Event Log entries reporting "Task Completed". Because of this, I assume, it is then not trigger on the next "startup".

    Anyway, the cure is:

    Control Panel | Power Options | Choose what the power button does
    Then untick "Turn on fast start-up (recommended)"

    Doing so makes no difference to start-up times (on this SSD-based PC).

    • Marked as answer by Peter Binney Wednesday, February 20, 2013 8:46 PM
    Wednesday, February 20, 2013 8:46 PM

All replies

  • 1. For which operating system have you assigned task?

    2. I test tasks in interactive mode (if it is possible)

    3. I used adapted batch files that redirect output to text file.

    Rgds

    Milos

    Sunday, January 6, 2013 10:57 AM
  • Hi Milos - I first tried the default (Windows Vista, Server 2008) and then changed to Windows 8. Neither worked.

    The task runs fine from the command line. The cy-test.bat script just contains:

    @echo off
    
    set LOG=c:\temp\cy-test.log
    
    echo.>>%LOG%
    date /t >>%LOG%
    time /t >>%LOG%
    echo ARG1 : %1 >>%LOG%
    echo ARG2 : %2 >>%LOG%
    
    set >>%LOG%
    

    • Marked as answer by Peter Binney Tuesday, January 8, 2013 6:49 PM
    • Unmarked as answer by Peter Binney Tuesday, January 8, 2013 6:49 PM
    Sunday, January 6, 2013 4:07 PM
  • Maybe blocked by some startup programs. You may try to run in Clean Boot Mode.

    Also I suggest you to set to re-run the task if it fails to start.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

    Monday, January 7, 2013 7:00 AM
    Moderator
  • Well - that's very interesting, Arthur. I have now done a Clean Boot (as per http://support.microsoft.com/kb/929135, and taking care to screenshot services before so I could ensure full restore).

    In the clean boot, the task ran.

    I then backed out the Clean Boot changes, and it still runs!

    I didn't need to change any task settings.

    So, yet another M$ mystery. Something doesn't work, nothing is logged. One fiddles and it comes back!

    I will keep an eye on it in case it regresses - but for now, many many thanks!

    Tuesday, January 8, 2013 6:49 PM
  • True to M$ form the problem is now back.

    Clearly this OS needs several more releases before it is as mature as XP.

    Such a nuisance ;-(

    Tuesday, January 22, 2013 7:28 PM
  • Problem solved. It is caused by "shutdown" no longer meaning that!

    My environment is a PC that is shut down every day and started the next.
    The "At System startup task" is a constantly-running process (actually a CygWin script) for various housekeeping tasks. Its logic assumes it is run once on each system start-up.

    But, by default when you shutdown this PC-hostile Operating System it doesn't.

    It goes into some semi-hibernate mode and the startup task is never fully "killed", despite its Event Log entries reporting "Task Completed". Because of this, I assume, it is then not trigger on the next "startup".

    Anyway, the cure is:

    Control Panel | Power Options | Choose what the power button does
    Then untick "Turn on fast start-up (recommended)"

    Doing so makes no difference to start-up times (on this SSD-based PC).

    • Marked as answer by Peter Binney Wednesday, February 20, 2013 8:46 PM
    Wednesday, February 20, 2013 8:46 PM
  • For info: having been running Windows10 for a year or so, and just had the "Anniversary update" inflicted on me, I had exactly the same problem. Yet again Windows had reset an option that I had set and I had to remind myself from the post above what to do to fix it.
    Tuesday, September 20, 2016 12:13 PM