Task Scheduler
   HOME

TheInfoList



OR:

Task Scheduler (formerly Scheduled Tasks) is a
job scheduler A job scheduler is a computer application for controlling unattended background program execution of job (computing), jobs. This is commonly called batch scheduling, as execution of non-interactive jobs is often called batch processing, though tr ...
in Microsoft Windows that launches
computer program A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components. A computer program ...
s or scripts at pre-defined times or after specified time intervals. Microsoft introduced this component in the Microsoft Plus! for
Windows 95 Windows 95 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of operating systems. The first operating system in the 9x family, it is the successor to Windows 3.1x, and was released to manufacturi ...
as ''System Agent.'' Its core component is an eponymous
Windows service In Windows NT operating systems, a Windows service is a computer program that operates in the background. It is similar in concept to a Unix daemon. A Windows service must conform to the interface rules and protocols of the Service Control Manage ...
. The Windows Task Scheduler infrastructure is the basis for the
Windows PowerShell PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-so ...
scheduled jobs feature introduced with PowerShell v3. Task Scheduler can be compared to cron or
anacron anacron is a computer program that performs periodic command scheduling, which is traditionally done by cron, but without assuming that the system is running continuously. Thus, it can be used to control the execution of daily, weekly, and month ...
on
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
s. This service should not be confused with the
scheduler A schedule or a timetable, as a basic time-management tool, consists of a list of times at which possible tasks, events, or actions are intended to take place, or of a sequence of events in the chronological order in which such things are i ...
, which is a core component of the OS
kernel Kernel may refer to: Computing * Kernel (operating system), the central component of most operating systems * Kernel (image processing), a matrix used for image convolution * Compute kernel, in GPGPU programming * Kernel method, in machine learn ...
that allocates CPU resources to processes already running.


Versions


Task Scheduler 1.0

Task Scheduler 1.0 is included with Windows NT 4.0 (with
Internet Explorer 4.0 Microsoft Internet Explorer 4 (IE4) is a graphical web browser that Microsoft unveiled in Spring of 1997, and released in September 1997, primarily for Microsoft Windows, but also with versions available for the classic Mac OS, Solaris (operating ...
or later),
Windows 2000 Windows 2000 is a major release of the Windows NT operating system developed by Microsoft and oriented towards businesses. It was the direct successor to Windows NT 4.0, and was released to manufacturing on December 15, 1999, and was officiall ...
,
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct upgrade to its predecessors, Windows 2000 for high-end and ...
and
Windows Server 2003 Windows Server 2003 is the sixth version of Windows Server operating system produced by Microsoft. It is part of the Windows NT family of operating systems and was released to manufacturing on March 28, 2003 and generally available on April 24, 2 ...
. It runs as a
Windows Service In Windows NT operating systems, a Windows service is a computer program that operates in the background. It is similar in concept to a Unix daemon. A Windows service must conform to the interface rules and protocols of the Service Control Manage ...
, and the task definitions and schedules are stored in
binary Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two digits (0 and 1) * Binary function, a function that takes two arguments * Binary operation, a mathematical operation that ta ...
.job files. Tasks are manipulated directly by manipulating the .job files. Each task corresponds to single action. On
Windows 95 Windows 95 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of operating systems. The first operating system in the 9x family, it is the successor to Windows 3.1x, and was released to manufacturi ...
(with
Internet Explorer 4.0 Microsoft Internet Explorer 4 (IE4) is a graphical web browser that Microsoft unveiled in Spring of 1997, and released in September 1997, primarily for Microsoft Windows, but also with versions available for the classic Mac OS, Solaris (operating ...
or later),
Windows 98 Windows 98 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. The second operating system in the 9x line, it is the successor to Windows 95, and was released to ...
and
Windows Me Windows Millennium Edition, or Windows Me (marketed with the pronunciation of the pronoun "me"), is an operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It is the successor to Windo ...
, the Task Scheduler runs as an ordinary program, mstask.exe. It also displays a status icon in the notification area on Windows 95 and Windows 98 and runs as a hidden service on Windows Me, but can be made to show a tray icon. Computer programs and scripts can access the service through six COM interfaces. Microsoft provides a scheduling agent DLL, a sample
VBScript VBScript (''"Microsoft Visual Basic Scripting Edition"'') is an Active Scripting language developed by Microsoft that is modeled on Visual Basic. It allows Microsoft Windows system administrators to generate powerful tools for managing computers ...
and a configuration file to automate Task Scheduler. In addition to the graphical user interface for Task Scheduler in Control Panel, Windows provides two command-line tools for managing scheduled task: at.exe (deprecated) and schtasks.exe. However, at.exe cannot access tasks created or modified by Control Panel or schtasks.exe. Also, tasks created with at.exe are not interactive by default; interactivity needs to be explicitly requested. The binary ".job" files which the AT command produces are stored in the %WINDIR%\Tasks directory.


Task Scheduler 2.0

Task Scheduler 2.0 was introduced with
Windows Vista Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, which was released five years before, at the time being the longest time span between successive releases of ...
and included in
Windows Server 2008 Windows Server 2008 is the fourth release of the Windows Server operating system produced by Microsoft as part of the Windows NT family of the operating systems. It was released to manufacturing on February 4, 2008, and generally to retail on F ...
as well. The redesigned Task Scheduler user interface is now based on Management Console. In addition to running tasks on scheduled times or specified intervals, Task Scheduler 2.0 also supports calendar and event-based triggers, such as starting a task when a particular event is logged to the ''event log'', or when a combination of events has occurred. Also, several tasks that are triggered by the same event can be configured to run either simultaneously or in a pre-determined chained sequence of a series of actions, instead of having to create multiple scheduled tasks. Tasks can also be configured to run based on system status such as being idle for a pre-configured amount of time, on startup, logoff, or only during or for a specified time.
XPath XPath (XML Path Language) is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) and can be used to compute values (e.g., strings, numbers, or Boolean v ...
expressions can be used to filter events from the Windows Event Log. Tasks can also be delayed for a specified time after the triggering event has occurred, or repeat until some other event occurs. Actions that need to be done if a task fails can also be configured. The actions that can be taken in response to triggers, both event-based as well as time-based, not only include launching applications but also take a number of custom actions. Task Scheduler includes a number of actions built-in, spanning a number of applications; including send an e-mail, show a message box, or fire a COM handler when it is triggered. Custom actions can also be specified using the Task Scheduler API. Task Scheduler keeps a history log of all execution details of all the tasks. Windows Vista uses Task Scheduler 2.0 to run various system-level tasks; consequently, the Task Scheduler service can no longer be disabled (except with a simple registry tweak). Task Scheduler 2.0 exposes an
API An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
to allow computer programs and scripts create tasks. It consists of 42 COM interfaces. The Windows API does not, however, include a managed wrapper for Task Scheduler though an open source implementation exists. The job files for Task Scheduler 2.0 are
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
-based, and are human-readable, conforming to the ''Task Scheduler Schema''.


Other features

* New security features, including using ''Credential Manager'' to passwords for tasks on workgroup computers and using
Active Directory Active Directory (AD) is a directory service developed by Microsoft for Windows domain networks. It is included in most Windows Server operating systems as a set of Process (computing), processes and Windows service, services. Initially, Active D ...
for task credentials on domain-joined computers so that they cannot be retrieved easily. Also, scheduled tasks are executed in their own session, instead of the same session as system services or the current user. * Ability to wake up a machine remotely or using BIOS timer from sleep or hibernation to execute a scheduled task or run a previously scheduled task after a machine gets turned on. * Ability to attach ''tasks'' to ''events'' directly from the
Event Viewer Event Viewer is a component of Microsoft's Windows NT operating system that lets administrators and users view the event logs on a local or remote machine. Applications and operating-system components can use this centralized log service to repo ...
.


Tasks

The Task Scheduler service works by managing ''Tasks''; ''Task'' refers to the action (or actions) taken in response to trigger(s). A task is defined by associating a set of actions, which can include launching an application or taking some custom-defined action, to a set of triggers, which can either be time-based or event-based. In addition, a task also can contain metadata that defines how the actions will be executed, such as the security context the task will run in. Tasks are serialized to .job files and are stored in the
special folder On Microsoft Windows, a special folder is a folder that is presented to the user through an interface as an abstract concept instead of an absolute folder path. (The synonymous term shell folder is sometimes used instead.) Special folders mak ...
titled ''Task Folder'', organized in subdirectories. Programmatically, the task folder is accessed using the ITaskFolder interface or the TaskFolder scripting object and individual tasks using the IRegisteredTask interface or RegisteredTask object.


Column 'Last Result'

The Last Result column displays a completion code. The common codes for scheduled tasks are: * 0 or 0x0: The operation completed successfully. * 1 or 0x1: Incorrect function called or unknown function called. * 2 or 0x2: File not found. * 10 or 0xa: The environment is incorrect. * 0x00041300: Task is ready to run at its next scheduled time. * 0x00041301: The task is currently running. * 0x00041302: The task has been disabled. * 0x00041303: The task has not yet run. * 0x00041304: There are no more runs scheduled for this task. * 0x00041305: One or more of the properties that are needed to run this task have not been set. * 0x00041306: The last run of the task was terminated by the user. * 0x00041307: Either the task has no triggers or the existing triggers are disabled or not set. * 0x00041308: Event triggers do not have set run times. * 0x80010002: Call was canceled by the message filter * 0x80041309: A task's trigger is not found. * 0x8004130A: One or more of the properties required to run this task have not been set. * 0x8004130B: There is no running instance of the task. * 0x8004130C: The Task Scheduler service is not installed on this computer. * 0x8004130D: The task object could not be opened. * 0x8004130E: The object is either an invalid task object or is not a task object. * 0x8004130F: No account information could be found in the Task Scheduler security database for the task indicated. * 0x80041310: Unable to establish existence of the account specified. * 0x80041311: Corruption was detected in the Task Scheduler security database * 0x80041312: Task Scheduler security services are available only on Windows NT. * 0x80041313: The task object version is either unsupported or invalid. * 0x80041314: The task has been configured with an unsupported combination of account settings and run time options. * 0x80041315: The Task Scheduler Service is not running. * 0x80041316: The task XML contains an unexpected node. * 0x80041317: The task XML contains an element or attribute from an unexpected namespace. * 0x80041318: The task XML contains a value which is incorrectly formatted or out of range. * 0x80041319: The task XML is missing a required element or attribute. * 0x8004131A: The task XML is malformed. * 0x0004131B: The task is registered, but not all specified triggers will start the task. * 0x0004131C: The task is registered, but may fail to start. Batch logon privilege needs to be enabled for the task principal. * 0x8004131D: The task XML contains too many nodes of the same type. * 0x8004131E: The task cannot be started after the trigger end boundary. * 0x8004131F: An instance of this task is already running. * 0x80041320: The task will not run because the user is not logged on. * 0x80041321: The task image is corrupt or has been tampered with. * 0x80041322: The Task Scheduler service is not available. * 0x80041323: The Task Scheduler service is too busy to handle your request. Please try again later. * 0x80041324: The Task Scheduler service attempted to run the task, but the task did not run due to one of the constraints in the task definition. * 0x00041325: The Task Scheduler service has asked the task to run. * 0x80041326: The task is disabled. * 0x80041327: The task has properties that are not compatible with earlier versions of Windows. * 0x80041328: The task settings do not allow the task to start on demand. * 0xC000013A: The application terminated as a result of a CTRL+C. * 0xC0000142: The application failed to initialize properly.


Bugs

On Windows 2000 and Windows XP, when a computer is prepared for
disk imaging A disk image, in computing, is a computer file containing the contents and structure of a disk volume or of an entire data storage device, such as a hard disk drive, tape drive, floppy disk, optical disc, or USB flash drive. A disk image is usua ...
with the sysprep utility, it cannot run tasks configured to run in the context of the SYSTEM account. Sysprep changes the
security identifier In the context of the Microsoft Windows NT line of operating systems, a Security Identifier (commonly abbreviated SID) is a unique, immutable identifier of a user, user group, or other security principal. A security principal has a single SID for ...
(SID) to avoid duplication but does not update scheduled tasks to use the new SID. Consequently, the affected tasks fail to run. There is no solution for this problem but one may reschedule the affected tasks to work around the issue. On Windows Vista or Windows Server 2008, the next execution time displayed in Task Scheduler may be wrong. Microsoft issued a
hotfix A hotfix or quick-fix engineering update (QFE update) is a single, cumulative package that includes information (often in the form of one or more files) that is used to address a problem in a software product (i.e., a software bug). Typically, hotf ...
to remedy this issue.


See also

* cron, job scheduler for Unix-like operating systems


References


Further reading

* * * * *


External links


Task Scheduler
on
MSDN Microsoft Developer Network (MSDN) was the division of Microsoft responsible for managing the firm's relationship with developers and testers, such as hardware developers interested in the operating system (OS), and software developers developing ...

The Log File in the Task Scheduler May Be Incorrectly Formatted and Difficult to Read
-
Unable to Delete Text in the Task Scheduler Log FileTask Scheduler Service Does Not StartScheduled Program Does Not Start in Task Scheduler
-
Cannot Disable Task Scheduler
{{Microsoft APIs Windows administration Windows services 1995 software