Windows Server Task Scheduler gives 0x1 as Last Run Result
Windows Server Task Scheduler gives 0x1 as Last Run Result
I am having a similar problem, and the FAQ below did not seem to help.
https://winscp.net/eng/docs/faq_scheduler
I am running Windows Server 2008 R2; The latest version of WinSCP 5.5.1; The task scheduler is running the script from an account with full admin rights;
I wrote a batch script to use WinSCP to connect to an FTP server, copy some files, and then exit. (This used to work for several months until recently. not sure what changed. possible an update to WinSCP). After the local files are uploaded to the FTP server, the batch file copies them to a backup directory.
The task scheduler still appears to run all the batch commands, because the backup directory is always updated. However, the FTP is failing.
I turned on logging from the WinSCP client (and script) to try and capture the problem, but I only get a log file when running the batch script—not the task scheduler.
Here is a sample log from a batch file session (run manually):
Again, this is the batch script log (run manually). When I run the script from Task Scheduler, it does not generate a log at all. Very frustrating.
Any idea what I might be doing wrong?
Re: Windows Server Task Scheduler gives 0x1 as Last Run Result
Re: Windows Server Task Scheduler gives 0x1 as Last Run Resu
I had also the similar issue, but now it is working fine with a minimum change while scheduling the task in the Windows Scheduler:
Re: Windows Server Task Scheduler gives 0x1 as Last Run Resu
I was having problems getting Task Sched to run my batch file, too. I’m using Windows Server 2008 R2.
I had to do two things:
1. Under Actions I had to add the folder to the «Start in» input. This allowed my batch file to run, but I was still getting the 0x1 Result code.
2. Under General I had to change the Configure for: to the correct operating system (not sure why it defaults to the incorrect one). This got rid of the 0x1 code.
Устранение неполадок, связанных с назначенными заданиями в 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 и закройте окно управления компьютером.
Last run result 0x1 что значит
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
Question
I have setup a task using Task Scheduler that I would like to use to launch a batch file at a certain time each day. The batch file works correctly when launched manually and the task also works correctly when the option ‘Run only when user is logged on’. However, as soon as I mark ‘Run whether user is logged on or not’ using the Administrator login, the task returns a Last Run Result of (0x1). This happens when trying to launch the file on demand or when it is scheduled at it’s daily time to run.
From some research I have done, I don’t believe I should see the actions of the batch file and the program that it launches when this option is marked, but I know it is not running correctly in the background due to the fact the log files are not generated from the task it is to complete. I have marked ‘Run with highest privileges’ and also entered information in the Start in field under Edit Action with no quotes. The history logs show that the task successfully finished, despite the lack of the Last Run Result code and no log files being generated. I have also verified the user being added to the Log on as a batch job option and that there are full permissions to the files (all on the local machine).
Does anyone have any insight to what I could be missing? If helpful, i could post the history logs as well.
Last run result 0x1 что значит
Вопрос
I have setup a task using Task Scheduler that I would like to use to launch a batch file at a certain time each day. The batch file works correctly when launched manually and the task also works correctly when the option ‘Run only when user is logged on’. However, as soon as I mark ‘Run whether user is logged on or not’ using the Administrator login, the task returns a Last Run Result of (0x1). This happens when trying to launch the file on demand or when it is scheduled at it’s daily time to run.
From some research I have done, I don’t believe I should see the actions of the batch file and the program that it launches when this option is marked, but I know it is not running correctly in the background due to the fact the log files are not generated from the task it is to complete. I have marked ‘Run with highest privileges’ and also entered information in the Start in field under Edit Action with no quotes. The history logs show that the task successfully finished, despite the lack of the Last Run Result code and no log files being generated. I have also verified the user being added to the Log on as a batch job option and that there are full permissions to the files (all on the local machine).
Does anyone have any insight to what I could be missing? If helpful, i could post the history logs as well.
Last run result 0x1 что значит
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
Question
I have setup a task using Task Scheduler that I would like to use to launch a batch file at a certain time each day. The batch file works correctly when launched manually and the task also works correctly when the option ‘Run only when user is logged on’. However, as soon as I mark ‘Run whether user is logged on or not’ using the Administrator login, the task returns a Last Run Result of (0x1). This happens when trying to launch the file on demand or when it is scheduled at it’s daily time to run.
From some research I have done, I don’t believe I should see the actions of the batch file and the program that it launches when this option is marked, but I know it is not running correctly in the background due to the fact the log files are not generated from the task it is to complete. I have marked ‘Run with highest privileges’ and also entered information in the Start in field under Edit Action with no quotes. The history logs show that the task successfully finished, despite the lack of the Last Run Result code and no log files being generated. I have also verified the user being added to the Log on as a batch job option and that there are full permissions to the files (all on the local machine).
Does anyone have any insight to what I could be missing? If helpful, i could post the history logs as well.



