Skip to content

Remove Scheduled Task

Removes a scheduled task from the Task Scheduler on the computer.\n\nSelect Task to remove a single scheduled task by name, or Folder to remove a complete folder in the Task Scheduler library including every task and subfolder it contains. Folder mode is useful when a product registers several scheduled tasks in its own folder and the whole folder should be cleaned up during uninstall.\n\nIn Folder mode the root of the Task Scheduler library and the complete Microsoft owned branch of the library, \Microsoft and every folder below it, can never be removed. If a single scheduled task inside that branch has to go, remove it by name with Task mode instead.\n\nBy default the brick completes without error when the task or folder is already gone, so it is safe to use in an uninstall workflow.

Required — Default: Task

Select what should be removed.\n\nTask removes a single scheduled task. The Task Name is used to find it.\n\nFolder removes the folder specified in Task Path from the Task Scheduler library, together with every scheduled task and every subfolder inside it. The Task Name is not used in this mode. Allowed values: Task, Folder.

Optional

The name of the scheduled task to remove, exactly as it is shown in Task Scheduler. Example: MyProduct Updater\n\nThis value is required when Remove Mode is Task and is ignored when Remove Mode is Folder. Wildcards are not accepted, so the name must be written in full.

Optional

The folder in the Task Scheduler library that contains the task. Example: \Contoso\MyProduct\n\nWhen Remove Mode is Task you can leave this empty. The task is then searched for in every folder in the library, and every task with that name is removed.\n\nWhen Remove Mode is Folder this is the folder that gets removed, and it must point at a folder below the root of the library. Leaving it empty, or pointing it at the root or at \Microsoft or any folder below \Microsoft, stops the brick with an error so the library and the Microsoft owned folders cannot be emptied by mistake.

Required — Default: True

Enable to let the workflow continue when the scheduled task or the folder does not exist. Nothing is removed and the reason is written to the log.\n\nDisable to stop the workflow with an error when the scheduled task or the folder cannot be found. Keep this enabled in an uninstall workflow, where the task may already have been removed.

  • Category: System
  • Brick ID: ScheduledTask-Remove