Here are some last run result codes for task scheduler:
I’ll add more when I get more results 🙂
Hercules
March 22nd, 2011 22:12:13
… some more last run result codes for task scheduler …
SCHED_S_TASK_DISABLED: 0x00041302 The task will not run at the scheduled times because it has been disabled.
SCHED_S_TASK_HAS_NOT_RUN: 0x00041303 The task has not yet run.
SCHED_S_TASK_NO_MORE_RUNS: 0x00041304 There are no more runs scheduled for this task.
SCHED_S_TASK_NOT_SCHEDULED: 0x00041305 One or more of the properties that are needed to run this task on a schedule have not been set.
SCHED_S_TASK_TERMINATED: 0x00041306 The last run of the task was terminated by the user.
Kaleu
April 4th, 2011 23:46:12
What about 0x41325?
Kaleu
April 5th, 2011 16:52:27
Genes
July 18th, 2011 12:09:43
Thanks for this . .
Do you know what (0x2) means? Not in above msdn doc.
found it v. difficult to find an explanation of what these codes mean eg not in Help file on Windows server = v. helpful (not).
admin
July 19th, 2011 01:03:23
What is your OS? Windows Server 2008 R2? Also what do you try to execute? (0x2) seems your executable can not find a file you specified.
Genes
July 26th, 2011 12:30:15
Yes, OS is Windows Server 2008 R2.
Job runs a script file, the executable is a program created by our software company. However the job itself all seems to run OK (ie files are updated etc).
Assumed there was a “standard” response that (0x02) meant.
Kevin
March 27th, 2013 14:12:18
Here is the full indexed list of return codes as google search is still showing your page in its results I though I’d point people to the full list as it is invaluable.
Twinkle
August 13th, 2013 04:52:58
what’s about 0xC0000142
The Col.
April 9th, 2014 03:39:28
Response to an ages-old question (Aug 2013)…. but hey .
From research it appears that 0xC0000142 is usually related to “Program Cannot Start” errors and these are usually caused by windows system files damage or broken dependency-chains
Siva
April 18th, 2014 00:38:57
What’s about 0x7F
Dhruv
June 17th, 2015 09:45:53
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. 0x41300: Task is ready to run at its next scheduled time. 0x41301: Task is currently running. 0x41302: Task is disabled. 0x41303: Task has not yet run. 0x41304: There are no more runs scheduled for this task. 0x41306: Task is terminated. 0x8004130F: Credentials became corrupted (*) 0x8004131F: An instance of this task is already running. 0x800704DD: The service is not available (is ‘Run only when an user is logged on’ checked?) 0xC000013A: The application terminated as a result of a CTRL+C. 0xC06D007E: Unknown software exception.
Shani
April 24th, 2019 18:16:44
Here are few I was able to gather from different sites
0 The operation completed successfully. 1 Incorrect function called or unknown function called. 2 File not found. 10 The environment is incorrect. 41300 The task is ready to run at its next scheduled time. 41301 The task is currently running. 41302 The task has been disabled. 41303 The task has not yet run. 41304 There are no more runs scheduled for this task. 41305 One or more of the properties that are needed to run this task have not been set. 41306 The last run of the task was terminated by the user. 41307 Either the task has no triggers or the existing triggers are disabled or not set. 41308 Event triggers do not have set run times. 41325 The Task Scheduler service has asked the task to run. 80010002 Call was canceled by the message filter 80041309 A task’s trigger is not found. 80041310 Unable to establish existence of the account specified. 80041311 Corruption was detected in the Task Scheduler security database 80041312 Task Scheduler security services are available only on Windows NT. 80041313 The task object version is either unsupported or invalid. 80041314 The task has been configured with an unsupported combination of account settings and run time options. 80041315 The Task Scheduler Service is not running. 80041316 The task XML contains an unexpected node. 80041317 The task XML contains an element or attribute from an unexpected namespace. 80041318 The task XML contains a value which is incorrectly formatted or out of range. 80041319 The task XML is missing a required element or attribute. 80041320 The task will not run because the user is not logged on. 80041321 The task image is corrupt or has been tampered with. 80041322 The Task Scheduler service is not available. 80041323 The Task Scheduler service is too busy to handle your request. Please try again later. 80041324 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. 80041326 The task is disabled. 80041327 The task has properties that are not compatible with earlier versions of Windows. 80041328 The task settings do not allow the task to start on demand. 0004131B The task is registered but not all specified triggers will start the task. 0004131C The task is registered but may fail to start. Batch logon privilege needs to be enabled for the task principal. 8004130A One or more of the properties required to run this task have not been set. 8004130B There is no running instance of the task. 8004130C The Task Scheduler service is not installed on this computer. 8004130D The task object could not be opened. 8004130E The object is either an invalid task object or is not a task object. 8004130F No account information could be found in the Task Scheduler security database for the task indicated. 8004131A The task XML is malformed. 8004131D The task XML contains too many nodes of the same type. 8004131E The task cannot be started after the trigger end boundary. 8004131F An instance of this task is already running. 0004131B The task is registered but not all specified triggers will start the task. 0004131C The task is registered but may fail to start. Batch logon privilege needs to be enabled for the task principal. 8004130A One or more of the properties required to run this task have not been set. 8004130B There is no running instance of the task. 8004130C The Task Scheduler service is not installed on this computer. 8004130E The object is either an invalid task object or is not a task object. 8004130F No account information could be found in the Task Scheduler security database for the task indicated. 8004131A The task XML is malformed. 8004131D The task XML contains too many nodes of the same type. 8004131E The task cannot be started after the trigger end boundary. 8004131F An instance of this task is already running. C000013A The application terminated as a result of a CTRL+C. C0000142 The application failed to initialize properly. 800704DD The service is not available (is ‘Run only when an user is logged on’ checked?) C06D007E Unknown software exception.
Alison M
October 23rd, 2019 19:28:45
What about 0xc004f074? Thanks.
satish
November 21st, 2019 08:55:24
how to resolve 0x10 and 0x2 error in task sched..
Источник
Устранение неполадок, связанных с назначенными заданиями в Windows XP и Windows Server 2003
Содержание
Аннотация
В статье приводится пошаговое описание устранений неполадок, связанных с назначенными заданиями в Windows XP и Windows Server 2003. Если назначенные задания не запускаются, для поиска источника проблем можно применить ряд способов.
Примечание. Администраторы и пользователи с полномочиями администраторов могут настроить планировщик заданий на отправку уведомления, если назначенное задание не запустилось так, как было запланировано. Для этого щелкните Уведомлять о пропущенных заданиях в меню Дополнительно.
Периодически проверяйте состояние назначенных заданий, поскольку иногда можно не заметить, что назначенное задание не запускается. С помощью пункта «Подробно» окна назначенных заданий просмотрите следующие сведения о каждом задании:
Расписание — Расписание запуска задания.
Время следующего запуска — время и дата следующего запуска задания.
Время прошлого запуска — время и дата предыдущего запуска задания.
Состояние — Текущее состояние задания.
Прошлый результат — Код выполнения последнего запуска.
Столбец Состояние содержит следующие сведения о состоянии и описание:
Пусто — Задание не запущено или было запущено и выполнено успешно.
Работает — Задание запущено.
Пропущено — Пропущена одна или несколько попыток запустить задание.
Запуск не удался — Предыдущая попытка запустить задание не удалась.
Столбец Прошлый результат показывает код выполнения. Полное описание всех кодов завершения Windows можно найти в MSDN, но обычные коды для назначенных заданий следующие:
0x0: Операция выполнена успешно.
0x1: Вызов неверной или неизвестной функции.
0xa: Ошибка в среде.
Если формат кода завершения «C0000XXX», задание не было успешно завершено («C» указывает на ошибку). Наиболее распространенный код завершения с «C» — «0xC000013A: Приложение завершено из-за нажатия сочетания клавиш CTRL+C».
Также проверьте следующие данные в свойствах задания:
Убедитесь, что установлен флажок, включающий выполнение задания.
Проверьте правильность пути к программе. Кроме того, проверьте, не требует ли программа для запуска каких-либо отсутствующих параметров командной строки.
Назначенные задания фиксируются в файле журнала (Schedlgu.txt) в папке c:\Windows. Журнал можно просмотреть из окна назначенных заданий, выбрав Просмотр журнала в меню Дополнительно.
Размер файла журнала 32 килобайта (КБ), после достижения максимального размера автоматически начинается запись с начала журнала поверх старых данных.
Для запуска заданий служба планировщика заданий должна быть запущена и правильно настроена. При остановке назначенных заданий вручную из окна назначенных заданий служба останавливается и не включается автоматически при следующем запуске компьютера. Если служба не настроена на запуск с использованием локальной системной учетной записи, она может не запуститься.
Проверка параметров службы:
В меню Пуск выберите пункт Панель управления, а затем Администрирование.
Щелкните значок Управление компьютером.
Разверните узел Службы и приложения и выберите элемент Службы.
Правой кнопкой мыши щелкните службу Планировщик заданий и выберите пункт Свойства.
На вкладке Общие проверьте, что тип запуска выбран как авто, и состояние службы — запущена. Если служба не запущена, нажмите Пуск.
На вкладке Вход в систему проверьте, что выбран пункт «С системной учетной записью» и установлен флажок Разрешить взаимодействие с рабочим столом.
Нажмите кнопку OK и закройте окно управления компьютером.
Источник
Why is my Scheduled Task updating its ‘Last Run Time’ correctly, and giving a ‘Last Run Result’ of ‘(0x0)’, but still not actually working?
I have a batch file which is set to run as a Scheduled Task on Windows Server 2012.
When I run the batch file by hand from the command line, it works. When I right-click on my task in Task Scheduler and manually run it, it still works fine.
But, if I let the task run according to the schedule set for it. then it seems to work sometimes, but not others.
I have already set the task to run as a given user; I have set its ‘Start in’ directory correctly; I have tried giving it highest privileges. None of that helps.
1 Answer 1
The basic answer is that the batch file for the task is running, and that the last step of the task is returning 0x0 . If the task is apparently ‘not doing anything’, it is because some earlier step of the task is failing silently
Why? In my case, and I think this could easily effect other people, the answer is that the batch file for a scheduled task sees different environment variables depending on whether the user it runs as is currently logged in or not.
More Detail:
In particular, if the task is set to run as Administrator, then while Administrator is logged in the task sees one set of variables (whether it is run manually or on the schedule), but when Administrator is not logged in, it sees a different set of variables.
This can be very hard to debug — basically, you need to put in a lot of logging!
When you are running a batch file as a Scheduled Task on Windows Server 2012, it only sees shared environment variables. It does not see the user specific environment variables for the user you have set it to run as, unless the user in question is currently logged in.
You can see the problem in action by putting SET > test.txt into a batch file on its own, and running it as a task in different circumstances (manually; on a schedule when logged in; on a schedule when not logged in).
UPDATE:
From more detailed testing, it seems that when the user which the task is set to run as is not logged in, the variables USERDNSDOMAIN, USERDOMAIN and USERNAME do get set correctly for that user anyway. The variable USERPROFILE gets set incorrectly to the value for the Windows default user (i.e. C:\Users\Default ). Everything else gets set incorrectly to the set of shared environment variables only (note that this is obviously not the correct set for the specified user, and is also not even the correct set for the Windows default user, which should get its user specific environment variables from HKEY_USERS\.Default\Environment ).
Note:
This is not the same issue as windows 7 task scheduler doesn’t use updated path , and in fact changes to any shared environment variables, including PATH , do get seen straight away (on the tests I did, on Windows 2012 R2), with no restart of any process.