Windows 8 and 8.1 Forums

Adding any task to Automatic Maintenance

  1. #1

    West Auckland
    Posts : 107
    Windows 8 Pro Pack x64

    Adding any task to Automatic Maintenance

    This is half FYI and half Question:

    I found out how to add a task to the Automatic Maintenance that runs each morning. I use Geekzone's EPG collector to fill in the guide on Media Centre and I though it would be nice for it to run as part of Automatic Maintenance rather than wake the computer up again later to do it's thing.

    Here's how:

    Create an XML files in notepad and paste this in...

    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.4" xmlns="">
    <Description>EPG Loader</Description>
    <Triggers />
    <Principal id="LocalSystem">
    <Actions Context="LocalSystem">
    <Command>C:\Program Files (x86)\Geekzone\EPG Collector\EPGCollector.exe</Command>

    Save the file then in Task Scheduler, import the XML and it will appear. Edit it from there further if you want.

    I got this from exporting a task that runs as part of Automatic Maintenance and edited it to suit.

    the thing is, I still don't know how it works! I have't been able to create a schedules task from scratch that runs as part of Automatic Maintenance.

    Other than plagiarising existing tasks to get what I want, does anyone know how it's really done?

    I have what I want, and it works great being able to run all the things I want all at the same time at 3AM each day, as part of Windows' ritual. Even better, if I disable it from waking the computer, everything runs when I'm logged in and Idle. It's fantastic.

    Any suggestions or something I missed?

      My System SpecsSystem Spec

  2. #2

    Posts : 446
    Win 8 64-bit

    I was hoping someone else would answer you as Iím not a programmer, but Iím guessing itís done by coding/editing the XML in a text editor, then importing it into Task Scheduler (which is what youíre doing anyway). Hereís what the Developer Network says:

    Creating an Automatic Maintenance task:
    This section details how developers can create a task using a task definition in XML or C language. Keep in mind that maintenance activity should not launch any user interface that requires user interaction, as Automatic Maintenance is completely silent and runs when the user is not present. Indeed, if the user interacts with the computer during Automatic Maintenance, any tasks in process will be ended until the next idle period. More info in below link.

    Automatic Maintenance (Windows)

    Defining an Automatic Maintenance Task:
    You can convert any Task Scheduler task to a maintenance task. To do so, you must confirm that your application can be suspended. Then, you must extend the task definition with the new MaintenanceSettings and AllowStartOnDemand elements.

    The main concern with creating a maintenance task is ensuring that the system can suspend and restart the task. The system will likely suspend a maintenance task multiple times; therefore, you need to ensure that your application is able to save its own state, and then resume at an arbitrary time. This ensures that the system does not perform the same part of your task repeatedly. More info in below link.

    Automatic Maintenance (Preliminary)

    MaintenanceSettings Definition:
    Specifies how often the task needs to be started during Automatic Maintenance.

    Specifies the amount of time after which the Task scheduler attempts to run the task during emergency Automatic Maintenance, if the task failed to complete during regular Automatic Maintenance.

    Indicates whether the Task scheduler must start the task during the Automatic Maintenance in exclusive mode.

    MaintenanceSettings (maintenanceSettingsType) Element (Windows)

    Period Format:
    Specifies how often the task needs to be started during Automatic maintenance.

    The format for this string is PnYnMnDTnHnMnS, where nY is the number of years, nM is the number of months, nD is the number of days, T is the date/time separator, nH is the number of hours, nM is the number of minutes, and nS is the number of seconds (for example, "PT5M" specifies 5 minutes and "P1M4DT2H5M" specifies one month, four days, two hours, and five minutes). The minimum value is one minute.

    Period Element (Windows)
      My System SpecsSystem Spec

  3. #3

    West Auckland
    Posts : 107
    Windows 8 Pro Pack x64

    Further to this topic, I have read into this more and discovered that it's not quite suitable in some cases. Microsoft recommends that ANY task that runs as part of Automatic Maintenance must be capable or pausing or stopping unexpectedly, which my Epg task is not. My Epg task may constantly stop and restart over and over and may never actually finish, which is not good.

    A task may be set as exclusive, which means that it will run last and on it's own, but will risk not running at all if the computer ceases to be idle until. It will run once it approaches it's deadline time however.

    So: use wisely.
      My System SpecsSystem Spec

Adding any task to Automatic Maintenance

Similar Threads
Thread Forum
Automatic Maintenance - Change Maintenance Settings in Windows 8
How to Change "Automatic Maintenance" Settings in Windows 8 and 8.1 Windows depends on execution of inbox and third party maintenance activity for much of its value-add, including Windows Update, and automatic disk defragmentation, as well as antivirus updates and scans. Additionally,...
Does Automatic Maintenance really have to run daily?
Exactly what is so important in Automatic Maintenance that it has to automatically run it daily as opposed to weekly or monthly, or every 2 days etc.? I know that with my other laptop running Vista, Microsoft Security Essentials virus definition updates happen daily, but doesn't take more than a...
General Support
Why can't I Start Maintenance? in Automatic Maintenance
When my 8.1 laptop lost time and I didn't understand why I looked in Control Panel/System Security/Action Centre and altho the Automatic Maintenance says No action needed the last run date is unknown and Windows was unable to determine the last date maintenance was run. If I try to Start...
Performance & Maintenance
Win 8 Keeps wanting to run Automatic Maintenance
Note: I've restarted the laptop and done sfc /scannow and found no problems. I didn't use my laptop for most of two weeks because my ac/dc adapter bit the dust. I only had some battery power. During that time, "I" performed no maintenance/update tasks. After getting a new adapter, the laptop...
Performance & Maintenance
Automatic Maintenance
Just had a few simple questions concerning "Automatic Maintenance." I have this set, and it is set to run daily at 3:00am. Sometimes, (on days off) I start this maintenance before the scheduled time. Anyways, here are my questions. 1. What does the maintenance actually do? 2. Is it...
Performance & Maintenance
automatic maintenance
Hello I noticed that automatic maintenance in Win 8 cannot be disabled. I maintain my pc regularly and do not need it. Is there a way to do it or should I let it run? Thank you, Peter
Performance & Maintenance
Automatic Maintenance can't be stopped
I can't change the Automatic Maintenance anymore. I guess i started it once manually and now its everrytime in progress. Pressing the stop button does nothing at all? Has anyone an idea how to force the stop or to get in the settings by a work around? Restarting and everything else does not...
Performance & Maintenance

Eight Forums Android App Eight Forums IOS App Follow us on Facebook