Scheduled Tasks Modifications
It is possible to create and delete scheduled tasks in Windows during project deployment. A set of scheduled tasks changes described in the project is displayed in the Scheduled Tasks view when the Scheduled Tasks node is selected in the Projects view. You can use the follow action to configure a scheduled task change in the project.
The Scheduled Task button from the New group on the regular Project and contextual Scheduled Tasks Ribbon pages should be used to add a new Windows scheduled task deployment change to the currently configured project.
When you configure a scheduled task you have to specify its general options, execution triggers, actions, executing conditions and run settings. All these configuration parameters and displayed in the correspond tabs of the New Scheduled Task dialog and are described below.
Task General Options
When you configure a new scheduled task you start from providing settings on the General tab of the New Scheduled Task dialog Pic 1. On this tab you have to specify a name of the task, task storage location and the name of the task author. You can also specify a description for the task, if required.
On the same tab you can also specify security options, such as a Windows user account to run the task. Click the Change User or Group… button to retrieve and select an account, otherwise a task will be executed using the system account. In this section you can configure the task to run only if the selected user account is logged on.
The program allows you to create a new scheduled task or delete an existing task on the package deployment, so you have to select the corresponding Operation option. You can also select an operation system compatibility options.
On the Triggers tab you can configure triggers to be used to activate the task. You can add one or multiple triggers using the Add button, located on the toolbar or in the context menu of the Triggers table Pic 2.
The program supports different types of triggers that are used to activate a task. Windows runs the task when the trigger condition is satisfied. Each trigger type contains its own configuration parameters depending on the nature of the trigger. Supported triggers are listed below.
System Startup Trigger
Run the task on the system startup, when the machine is booted.
Computer Idle Trigger
Run the task when the machine is in the idle state.
User Logon Trigger
Run the task when a user logs on into system.
Run the task on the regular basis – daily, weekly, etc.
Run the task when a specific event occurs.
Run Once Trigger
Run the task at the specified date and time.
Task Registration Trigger
Run the task when a task is created or modified.
User Session Trigger
Run the task when a user connects or disconnects the system locally or remotely, or when the workstation is locked or unlocked.
Windows Notification Trigger
Run the task when a specific Windows Notification Facility (WNF) code occurs.
Each trigger type can have custom configuration depending on the trigger type and also has common configuration suitable for all trigger types. Let’s take a look at the trigger configuration. For example, when you configure a User Logon Trigger Pic 3, you need to specify a user account to fire the trigger or select the option to fire the trigger for any user. This configuration is specific for this type of the trigger.
Other trigger configuration options are the same for all types of triggers. You can delay the task for the configured time interval. Or you can repeat the task execution. Or stop the task if it runs longer than the specified period. It is also possible to activate and expire the task at configured date and time.
A task can run one or multiple actions that are configured on the Actions tab. Pic 4 You can add a new action by pressing the Add button on the toolbar of the Actions table or select the Add option in the context menu.
It is possible to start a program or run a COM object as a task action. When you configure a program you have to specify a program or script to run, its execution arguments and the start folder. For a COM object you should specify ClassID and data.
On the Conditions tab you need to configure conditions that should be satisfied to run the task. Pic 5 You can configure a task to be started only when a computer is in the idle state. Specify how long the computer should be in idle before running this task and how long to wait for idle.
You can also configure to run the task when the machine runs on AC power or wake the machine to run the task.
On the Settings tab you can configure task running and creating options. Pic 6 These options configure various aspects of task behavior – how it can be started, what to do on the task failure, how task should be stopped, etc.
On the same tab you can also configure task creation options. It is possible to create a hidden and disabled task.