Skip to content

Create Scheduled Task

Creates a scheduled task on the computer. The task can either be built from the settings on this brick or created from a task definition file exported from Task Scheduler, which is the easiest way to create a complex task.\n\nAn existing task with the same name in the same folder is only replaced when Overwrite is enabled, so a duplicate task is never created by accident.\n\nAdd the [Download Content] PowerBrick when the task definition file is delivered with the package.

Required — Default: Build From Settings

Choose how the scheduled task is defined.\n\nBuild From Settings: The task is created from the trigger, program and account settings on this brick.\n\nImport From File: The task is created from a task definition file exported from Task Scheduler. Use this for tasks that need more than one trigger or action, or any setting that is not available on this brick.\n\nThe settings that do not belong to the selected source are ignored. Allowed values: Build From Settings, Import From File.

Required

The name the task gets in Task Scheduler. This name is also used to check whether the task already exists.\n\nExample: Nightly Cleanup\n\nThe characters \ / : * ? “ < > | cannot be used in a task name.

Optional — Default: \

The folder in the Task Scheduler library where the task is placed. The folder is created if it does not exist.\n\nExample: \CapaOne\n\nLeave the value as \ to place the task in the top level of the library.

Optional

The full path to a task definition file exported from Task Scheduler. Only used when the source is Import From File, and required in that case.\n\nExample: $PackageRoot\NightlyCleanup.xml\n\nRemember the [Download Content] PowerBrick when the file is delivered with the package. The brick fails if the file is missing or is not a valid task definition.

Optional — Default: Daily

Decides when the task runs. Only used when the source is Build From Settings.\n\nAt Logon: Every time a user logs on.\nAt Startup: Every time the computer starts.\nDaily: Every day at the start time.\nOnce: A single time at the start time.\n\nDaily and Once also require a start time. Allowed values: At Logon, At Startup, Daily, Once.

Optional — Default: 01:00

The time the task starts. Required for the Daily and Once triggers, and ignored for the other triggers.\n\nExample: 08:00\nExample: 2026-01-31 08:00\n\nThe field starts at 01:00, which suits the daily trigger it is paired with: the machine is normally on, nobody is working, and a task that takes a while disturbs no one. Change it if the work has to happen at a particular time of day.\n\nWhen only a time is given for the Once trigger and that time has already passed today, the task is scheduled for the next day.

Optional

The full path to the program or script the task runs. Only used when the source is Build From Settings, and required in that case.\n\nExample: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe\n\nThe program must already be on the device and stay there, because the task runs later - possibly days later. Do not point this at the package folder: that folder belongs to this installation only. Copy the file to a permanent folder first, for example with the [Copy File] PowerBrick, and point the task at the copy.

Optional

The command line arguments given to the program. Leave empty when the program does not need any.\n\nExample: -ExecutionPolicy Bypass -File “C:\Scripts\Cleanup.ps1”\n\nA script named here has to follow the same rule as the program itself: it must be in a permanent folder, not in the package folder, because the task runs long after this installation has finished.

Optional

The folder the program is started in. Leave empty to let Windows decide. Some programs fail when they are started from the wrong folder.\n\nExample: C:\Scripts

Optional — Default: SYSTEM

The account the task runs as.\n\nSYSTEM: Runs in the background with full rights on the computer and without a user interface.\nUsers: Runs for any user that is logged on, with that user’s rights.\nCustom Account: Runs as the account given below, which also requires a password.\n\nWhen the source is Import From File the account from the file is used, unless Custom Account is selected here. Allowed values: SYSTEM, Users, Custom Account.

Optional

The account the task runs as when Custom Account is selected. Required in that case, and ignored otherwise.\n\nExample: CONTOSO\svc-cleanup\nExample: .\LocalServiceUser

Optional

The password for the account above. Required when Custom Account is selected, and ignored otherwise.\n\nThe password is never written to the job log. The task keeps the password so it can run when nobody is logged on, so remember to update the task if the password is changed later.

Optional — Default: True

Enable to run the task with the highest rights the account has, which is needed for tasks that change the system. Disable to run the task with normal rights. The setting is ignored when the task is created from a task definition file, because the file decides it.

Optional — Default: False

Enable to replace a task that already exists with the same name in the same folder. Disable to stop with an error instead, so an existing task is never changed by accident.

  • Category: System
  • Brick ID: ScheduledTask-Create