Windows Task Scheduler: Difference between revisions

Content deleted Content added
No edit summary
Monkbot (talk | contribs)
m Task 18 (cosmetic): eval 19 templates: del empty params (6×); hyphenate params (26×);
Line 25:
| publisher = The Syracuse Newspapers
| date = March 29, 1998
| accessdateaccess-date = 2007-10-06
}}</ref> but was renamed to ''Task Scheduler'' in [[Internet Explorer 4.0]] and [[Windows 98]]. The [[Windows Event Log]] service must be running before the Task Scheduler starts up.
 
Line 36:
| url = http://msdn2.microsoft.com/en-us/library/aa446802.aspx
| title = About the Task Scheduler
| accessdateaccess-date = 2007-10-06
| work = [[MSDN]]
| publisher = [[Microsoft]]
}}</ref> It runs as a [[Windows Service]], and the task definitions and schedules are stored in [[Binary file|binary]] <code>.job</code> files. Tasks are manipulated directly by manipulating the <code>.job</code> files. Each task corresponds to single action. On [[Windows 95]] (with [[Internet Explorer 4.0]] or later), [[Windows 98]] and [[Windows Me]], the Task Scheduler runs as an ordinary program, <code>mstask.exe</code>. 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.<ref>{{cite web|url=http://support.microsoft.com/kb/272962|title=How to Enable the Scheduled Tasks Icon in Windows Me|date=January 29, 2007|work=Support|publisher=[[Microsoft]]|url-status=dead|archiveurlarchive-url=https://web.archive.org/web/20080130185556/http://support.microsoft.com/kb/272962|archivedatearchive-date=January 30, 2008}}</ref> Computer programs and [[Scripting language|scripts]] can access the service through six [[Component Object Model|COM]] [[Interface (computing)|interfaces]].<ref>{{Cite web|url = https://msdn.microsoft.com/en-us/library/windows/desktop/aa383581%28v=vs.85%29.aspx|title = Task Scheduler 1.0 Interfaces|access-date = |accessdate = 30 May 2014|website = [[MSDN]]|publisher = [[Microsoft]]|last = |first = }}</ref> Microsoft provides a scheduling agent DLL, a sample [[VBScript]] and a configuration file to automate Task Scheduler.<ref>{{cite web|url=http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=601d75e2-f907-4e51-ad88-adb818df1d27|title=Task Scheduler Using VBScript|work=Download Center|publisher=[[Microsoft]]|date=March 22, 2004|url-status=dead|archiveurlarchive-url=https://web.archive.org/web/20060504033359/http://www.microsoft.com/downloads/details.aspx?FamilyID=601d75e2-f907-4e51-ad88-adb818df1d27&displaylang=en|archivedatearchive-date=May 4, 2006}}</ref>
 
In addition to the graphical user interface for Task Scheduler in [[Control Panel (Windows)|Control Panel]], Windows provides two command-line tools for managing scheduled task: <code>[[at (command)|at.exe]]</code> (deprecated) and <code>schtasks.exe</code>.<ref>{{cite web|title=Schtasks|url=https://technet.microsoft.com/en-us/library/bb490996.aspx|work=[[Microsoft TechNet]]|publisher=[[Microsoft]]|accessdateaccess-date=18 May 2014}}</ref><ref>{{cite web|title=At|url=https://technet.microsoft.com/en-us/library/bb490866.aspx|work=[[Microsoft TechNet]]|publisher=[[Microsoft]]|accessdateaccess-date=18 May 2014}}</ref> However, <code>at.exe</code> cannot access tasks created or modified by Control Panel or <code>schtasks.exe</code>.<ref>{{Cite web|url = http://support.microsoft.com/kb/313565|title = How To Use the AT Command to Schedule Tasks|date = 30 October 2006|website = Support|publisher = [[Microsoft]]}}</ref> Also, tasks created with <code>at.exe </code>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.<ref>{{Cite web|url = http://support.microsoft.com/kb/121562/EN-US|title = Applications Started with AT Are Not Interactive|date = 20 February 2007|website = Support|publisher = [[Microsoft]]|url-status=dead|archiveurlarchive-url=https://web.archive.org/web/20041029024318/http://support.microsoft.com/kb/121562/EN-US/|archivedatearchive-date=October 29, 2004}}</ref>
 
===Task Scheduler 2.0===
Line 48:
|title=Windows Vista Task Scheduler
|date=March 3, 2006
|accessdateaccess-date=April 24, 2006
|work=[[Microsoft TechNet]]
|publisher=[[Microsoft]]
|url-status=dead
|archiveurlarchive-url=https://web.archive.org/web/20060412035343/http://www.microsoft.com/technet/windowsvista/mgmntops/taskschd.mspx
|archivedatearchive-date=April 12, 2006
}}</ref> Windows Vista uses Task Scheduler 2.0 to run various system-level tasks;<ref>{{cite web|url=http://support.microsoft.com/kb/939039|title=Description of the scheduled tasks in Windows Vista|date=August 24, 2007|url-status=live|archiveurlarchive-url=https://web.archive.org/web/20071022033307/http://support.microsoft.com/kb/939039|archivedatearchive-date=October 22, 2007}}</ref> consequently, the Task Scheduler service can no longer be disabled (except with a simple registry tweak).
 
Task Scheduler 2.0 exposes an [[API]] to allow computer programs and scripts create tasks.<ref name="kerr">{{cite web
Line 62:
| work = [[MSDN]]
| publisher = [[Microsoft]]
| accessdateaccess-date = 2007-10-06
| date = October 2007
| url-status=dead
| archiveurlarchive-url = https://web.archive.org/web/20071226223747/http://msdn.microsoft.com/msdnmag/issues/07/10/WindowsCPP/
| archivedatearchive-date = December 26, 2007
}}</ref> It consists of 42 [[Component Object Model|COM]] [[Interface (computing)|interfaces]].<ref>{{Cite web|url = https://msdn.microsoft.com/en-us/library/aa383600%28v=vs.85%29.aspx|title = Task Scheduler 2.0 Interfaces|access-date = |accessdate = 30 May 2014|website = [[MSDN]]|publisher = [[Microsoft]]|last = |first = }}</ref> The Windows API does not, however, include a [[Managed code|managed]] wrapper for Task Scheduler though an open source implementation exists.<ref>{{Cite web|url=https://stackoverflow.com/questions/3977801/c-sharp-api-for-task-scheduler-2-0|title=C# API for Task Scheduler 2.0|website=Stack Overflow|access-date=2019-07-24}}</ref> The job files for Task Scheduler 2.0 are [[XML]]-based, and are human-readable, conforming to the ''Task Scheduler Schema''.<ref name="kerr"/>
 
====Other features====
Line 80:
| work = [[MSDN]]
| publisher = [[Microsoft]]
| accessdateaccess-date = 2007-10-06
}}</ref>
 
==Column 'Last Result'==
The Last Result column displays a completion code. The common codes for scheduled tasks are:<ref>{{cite web|title=How to troubleshoot scheduled tasks in Windows XP and in Windows Server 2003|url=http://support.microsoft.com/kb/308558|work=Support|publisher=[[Microsoft]]|accessdateaccess-date=3 Sep 2013|date=22 May 2013}}</ref><ref>{{cite web|url=http://msdn.microsoft.com/en-gb/library/windows/desktop/aa383604(v=vs.85).aspx|title=Task Scheduler Error and Success Constants|work=[[MSDN]]|publisher=[[Microsoft]]}}</ref>
 
* 0 or 0x0: The operation completed successfully.
Line 136:
 
==Bugs==
On Windows 2000 and Windows XP, tasks assigned to run with SYSTEM privileges do not function when the computer is prepared for [[disk imaging]] with <code>[[sysprep]]</code>. Sysprep changes the [[security identifier]] (SID) to avoid duplication but does not update scheduled tasks to use the new SID. Consequently, all SYSTEM scheduled tasks fail to run on the imaged computers. There is no solution for this problem but one may reschedule the tasks to work around the issue.<ref>{{cite web|title=Scheduled tasks may not start if you used a System Preparation image to install Windows XP or Windows 2000|url=http://support.microsoft.com/kb/313111|work=Support|publisher=[[Microsoft]]|accessdateaccess-date=19 May 2012|date=1 July 2004|url-status=dead|archiveurlarchive-url=https://web.archive.org/web/20080926011921/http://support.microsoft.com/kb/313111|archivedatearchive-date=26 September 2008}}</ref>
 
On Windows Vista or Windows Server 2008, where Service Pack 2 is not installed,<!-- To source checkers: You need to expand tables in File information section to reveal this information --> the next execution time displayed in Task Scheduler may be wrong.<ref>{{cite web|title=The value in the Next Run Time field in Task Scheduler is incorrect in Windows Vista and in Windows Server 2008|url=http://support.microsoft.com/kb/950035|work=Support|publisher=[[Microsoft]]|accessdateaccess-date=19 May 2012|date=15 October 2008}}
</ref>