Планировщик задач ошибка 0x2

У меня есть идентичные запланированные задачи, работающие в Windows XP Pro и Windows 7. XP Pro One работает нормально, Windows 7 всегда возвращает 0x2 (что означает ,что «система не может найти указанный файл»; однако выполнение из командной строки не является проблемой) в столбце результат последнего запуска пользовательского интерфейса планировщика задач.

запланированная задача выполняет a .bat файл ежедневно. Тот. bat-файл содержит вызов для выполнения сценария Perl. Как я уже говорил в предыдущем абзаце, он выполняется под XP без каких-либо проблем, но под Windows 7, нет кости.

задач в Windows 7 имеет значение «запустить ли пользователь вошел в систему или нет.»В данном случае это я, я-единственный пользователь системы. Он также имеет значение » запуск с наивысшими привилегиями.»И это не скрывается. Тот. bat-файл отлично работает из командной строки — он вызывает скрипт Perl, как и ожидалось, и скрипт Perl делает свое дело.

Я искал повсюду в поисках подходящего ответа на этот вопрос вопрос. До сих пор я ничего не нашел. Что, черт возьми, происходит с этой запланированной задачей Win7? Я готова вырвать свои волосы.

5 ответов

Я имел эту проблему. 0x2 из планировщика задач, казалось, сказать, что он не мог найти пакетный файл. Это было ложно — я добавил некоторые стрелки канала ( > > ) для вывода моего пакетного файла в файл журнала, а затем запустил запланированную задачу.

несмотря на получение 0x2 в планировщике задач, я обнаружил, что пакетный файл действительно запущен, но обнаружил ошибку (которая обнаружилась в файле журнала).

еще одна вещь, чтобы попытаться запустить задачу в качестве системы или сетевой службы вместо этого.

6

отвечен KERR 2023-02-09 09:27

У меня была такая же проблема и я ее решил. На вкладке Действия в разделе Программа / сценарий: просто введите имя пакетного файла. В разделе» Start In (необязательно): «укажите путь к файлу без кавычек и косой черты.

пример ниже для запуска теста.bat-файл из тестовой папки в корне C:

Программы/Скрипта:
испытание.летучая мышь

Start In (необязательно):
C:\Test

2

отвечен Chris 2023-02-09 11:44

Я пытался синхронизировать пару папок с SyncToy 2.1 на двух рабочих станциях Windows 7 SP1. Сначала я просто просматривал файл и добавлял аргументы для задачи. Он вернул код 0x2. Microsoft TechNet рекомендует использовать поле «Start In», чтобы убедиться, что имя файла разрешено в правильное расположение. Я скопировал путь к каталогу SyncToy без кавычек или косой черты в поле «Start In», сохранил его и запустил задачу. Результатом стал успех, код 0x0!

1

отвечен Jeff Lehman 2023-02-09 14:01

в моем случае я использовал подключенный диск в качестве назначения, но диск не был сопоставлен в контексте сценария (пользователь вышел из системы), поэтому мне пришлось сопоставить диск внутри сценария, прежде чем я мог использовать это сопоставление.

пример:

@echo off
net use Z: \server\share /u:domain\username *password*
robocopy c:\folder Z:\backup /o /p /t /i /o /n /s

1

отвечен Levi 2023-02-09 16:18

аналогично @Levi, я использовал подключенный сетевой диск. Однако в моем случае более простым решением было изменить его использование UNC-путей. Например, вместо использования этого аргумента:

"W:\blah\script.py"

Я теперь использую этот аргумент:

"\file-server-02\path\blah\script.py"

0

отвечен Son of a Beach 2023-02-09 18:35

@DavidYorkshire 

Hello DavidYorkshire,

I hope you are doing well!

There is no need for you to worry about a 0x2 error in the task scheduler. It’s quite easy to fix it. However, you will have to follow the below steps to encounter the task scheduler issue.

The task scheduler executes the .cmd or .bat files, which have to be performed with the administrator’s help. The administrator gives access to the administrative rights to run the tasks from the assigned account to save time from scheduling them daily. However, even if the rights have been given, sometimes it fails to perform the duty. As a result, the last run result of 0x2 failed because access had been denied.

In order to fix the issue, firstly, we need to know the cause of the issue. 

The error 0x2 result means that the file could not be found. Thus, make sure that when the Task starts, the batch file exists and is accessible. Also, it means «Access denied«; thus, you must check if you were facing a permission issue.

We can fix this issue in two possible ways:

1) Fix the issue with the help of a repair tool kit:

  • Download the repair tool kit from the browser.
  • Follow the prompts and install the program. On the welcome screen, you should untick the automatic scan option.
  • Now, Click on install.
  • After the installation process, the software will automatically scan your PC and show the damaged areas in your PC which have to be fixed
  • Click on the Repair button to fix the task scheduler error.
  • Restart your PC.

2) Override the properties with the least privileges:

You can also try to configure the Scheduled Task to Run with the highest privileges in the Properties dialog of the Task.

  • Double click on the particular Task, and go to properties.
  • Kindly change it to Run with the highest privileges and click on OK.
  • Enter the password.
  • Thus, it allows the tasks to run without any error code.

If the problem persists, then try below to fix it,

You will have to disable logging in your robocopy script as it may create problems whenever the scheduler runs a task.

You must ensure that the file path you have given is correct because an incorrect file path can cause a 0x2 error. Also, check the permission as it can also be a reason for the error.

I hope the above fixes work for you, but if the problem persists, then we’ll investigate further to overcome the error.

———————-

Regards,

Austin_M

I’m trying to do mysql batabase dump periodically through task scheduler. When I run the following query from command prompt, it gives me the dump. But, when I’m running through Task Scheduler, it’s not working.

Query

C:\xampp\mysql\bin\mysqldump.exe --user=root --password=root --host=localhost --database  gm > E:\backupgmdb\gm_backup_%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.sql

Task Scheduler error —
0x2 error screenshot
enter image description here

Task Action Definition Screen Print
enter image description here

asked May 27, 2017 at 17:28

Alias's user avatar

make .bat file, let say c:\xampp\mysql\bin\backup.bat and execute it from scheduller. put into .bat file this commands:

c:
cd \
cd C:\xampp\mysql\bin\
C:\xampp\mysql\bin\mysqldump.exe --user=root --password=root --host=localhost --database  gm > E:\backupgmdb\gm_backup_%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.sql

Plus, read this: https://serverfault.com/questions/734035/running-a-batch-file-from-task-scheduler-without-user-being-logged-in

The Task Scheduler in Windows Server 2008 R2 and later and Windows Vista and later executes tasks under a «least privileges» security context by default.

Open the properties of the task and check Run with highest privileges. Press OK, then enter the password for the administrative account when prompted. This will override the default «least privileges» behavior and will allow the task to run with administrative privileges.

answered May 28, 2017 at 18:45

Mihail Kuznesov's user avatar

Содержание

  1. Ошибка Планировщика заданий «Удаленный компьютер не найден» и способ ее исправить
  2. Запланированная задача Windows 7 возвращает 0x2
  3. 5 ответов
  4. (0x2) when running a scheduled task as administrator in 2012r2
  5. Key Considerations for AWS Backup
  6. 17 Replies
  7. Read these next.
  8. Snap! — Holograms, RATs, Inflatable Heat Shields, Drone Swarms, Fake Americans
  9. Spark! Pro series — 3rd November 2022
  10. HPE MSA or Nimble — Need Advice
  11. Aws, Azure, Google cloud
  12. Department to purchase/deploy laptops & equipment?

Ошибка Планировщика заданий «Удаленный компьютер не найден» и способ ее исправить

П ланировщик заданий Windows хоть и не относится к особо популярным штатным инструментам системы, может оказаться весьма полезным, когда дело касается автоматизации задач по самообслуживанию ОС или выполнения каких бы то ни было иных пользовательских действий. Но вот вы пробуете его открыть и получаете следующее сообщение: Удаленный компьютер не найден. Ошибка при чтении данных.

Неполадка эта может быть связана с некорректной работой ответственной за планировщик службы, а точнее её деактивацией.

Чтобы проверить её состояние, нажатием Win + R вызовите окошко Run , выполните в нём команду services.msc и отыщите в открывшемся окне управления службами службу «Планировщик заданий». Двойным кликом по ней откройте её свойства и убедитесь, что тип запуска службы установлен «Автоматически», а сама она выполняется .

Если служба не выполняется или вы видите иные настройки, скорее всего, проблема именно в этом. Поскольку изменение настроек для этой службы по умолчанию недоступны, придётся прибегнуть к редактированию реестра.

Командой regedit откройте редактор реестра и разверните ветку

В последнем подразделе должен быть DWORD-параметр Start. Установите в качестве его значения 2 в шестнадцатеричной системе счисления, сохраните результат редактирования и перезагрузите компьютер.

После этого Планировщик заданий должен запуститься без ошибки.

Источник

Запланированная задача Windows 7 возвращает 0x2

У меня есть идентичные запланированные задачи, работающие в Windows XP Pro и Windows 7. XP Pro One работает нормально, Windows 7 всегда возвращает 0x2 (что означает ,что «система не может найти указанный файл»; однако выполнение из командной строки не является проблемой) в столбце результат последнего запуска пользовательского интерфейса планировщика задач.

запланированная задача выполняет a .bat файл ежедневно. Тот. bat-файл содержит вызов для выполнения сценария Perl. Как я уже говорил в предыдущем абзаце, он выполняется под XP без каких-либо проблем, но под Windows 7, нет кости.

задач в Windows 7 имеет значение «запустить ли пользователь вошел в систему или нет.»В данном случае это я, я-единственный пользователь системы. Он также имеет значение » запуск с наивысшими привилегиями.»И это не скрывается. Тот. bat-файл отлично работает из командной строки — он вызывает скрипт Perl, как и ожидалось, и скрипт Perl делает свое дело.

Я искал повсюду в поисках подходящего ответа на этот вопрос вопрос. До сих пор я ничего не нашел. Что, черт возьми, происходит с этой запланированной задачей Win7? Я готова вырвать свои волосы.

5 ответов

Я имел эту проблему. 0x2 из планировщика задач, казалось, сказать, что он не мог найти пакетный файл. Это было ложно — я добавил некоторые стрелки канала ( > > ) для вывода моего пакетного файла в файл журнала, а затем запустил запланированную задачу.

несмотря на получение 0x2 в планировщике задач, я обнаружил, что пакетный файл действительно запущен, но обнаружил ошибку (которая обнаружилась в файле журнала).

еще одна вещь, чтобы попытаться запустить задачу в качестве системы или сетевой службы вместо этого.

У меня была такая же проблема и я ее решил. На вкладке Действия в разделе Программа / сценарий: просто введите имя пакетного файла. В разделе» Start In (необязательно): «укажите путь к файлу без кавычек и косой черты.

пример ниже для запуска теста.bat-файл из тестовой папки в корне C:

Программы/Скрипта: испытание.летучая мышь

Start In (необязательно): C:Test

Я пытался синхронизировать пару папок с SyncToy 2.1 на двух рабочих станциях Windows 7 SP1. Сначала я просто просматривал файл и добавлял аргументы для задачи. Он вернул код 0x2 . Microsoft TechNet рекомендует использовать поле «Start In», чтобы убедиться, что имя файла разрешено в правильное расположение. Я скопировал путь к каталогу SyncToy без кавычек или косой черты в поле «Start In», сохранил его и запустил задачу. Результатом стал успех, код 0x0 !

в моем случае я использовал подключенный диск в качестве назначения, но диск не был сопоставлен в контексте сценария (пользователь вышел из системы), поэтому мне пришлось сопоставить диск внутри сценария, прежде чем я мог использовать это сопоставление.

аналогично @Levi, я использовал подключенный сетевой диск. Однако в моем случае более простым решением было изменить его использование UNC-путей. Например, вместо использования этого аргумента:

Источник

(0x2) when running a scheduled task as administrator in 2012r2

I have a batch file I am trying to fun from the task scheduler in 2012r2 and I am getting the the error above. When I am running it manually from the task scheduler I can actually see that the script is running but it ends with the (0x2). When I am running it outside the task scheduler straight from the folder it runs without a problem so i speculate that there’s something broken with the actual task and I bet that it’s something with the action. Here are some screenshot which provide more information so hopefully someone can help me with what’s missing.

I also tried running it with a 2008r2 configuration, as well as with 2008 configuration but it’s still not working.

Key Considerations for AWS Backup

Put a full path in for the log. C:scriptsrobocopylog.txt

Maybe the relative path is confusing it

0x2 is usually file not found. Are you sure that path is correct?

Check the event viewer for why it failed. I bet you it’s something silly.

0x2 is usually file not found. Are you sure that path is correct?

Check the event viewer for why it failed. I bet you it’s something silly.

by the way: the history says «task scheduler successfully finished»

Do you have logging enabled in your robocopy script? It may be returning the 0x2 error

I really feel like you don’t need those quotes in the path either

Do you have logging enabled in your robocopy script? It may be returning the 0x2 error

I really feel like you don’t need those quotes in the path either

These are being added automatically when I navigate to the path

When you run it, are you using the same creds as the schedule task?

When you run it, are you using the same creds as the schedule task?

Have you checked the box to run with the highest privledges​ in the task scheduler

Have you checked the box to run with the highest privledges​ in the task scheduler

Have you checked the box to run with the highest privledges​ in the task scheduler

When you run it, are you using the same creds as the schedule task?

Do you have logging enabled in your robocopy script? It may be returning the 0x2 error

Here’s the script:

robocopy \nas2ftp v:nas2backupsftp /copyall /e /tee /log:robocopylog.txt
pause

Put a full path in for the log. C:scriptsrobocopylog.txt

Maybe the relative path is confusing it

Put a full path in for the log. C:scriptsrobocopylog.txt

Maybe the relative path is confusing it

I realize this thread is old but I found it quite useful at helping me think towards a different solution.

In case anyone else runs into this issue. I had the same problem and regardless if I used a Remote path, a mapped drive to a remote location or a local drive I was still getting the 0x2 error.
What I did was simply add a 5 second wait to the end of my batch file before exiting.

This machine is not on the domain (and in DMZ) syncing with a machine that IS on the domain, hence the added line to create a mapped drive.
If both your machines are on the same domain the first line isn’t needed.

if not exist K: net use K: \SERVER_NAMED$Applications /user:USERNAME PASSWORD /persistent:no
robocopy «D:SoftwareRepository» «K:» /e /xo /Copy:DATSO /FFT /XA:H /R:1 /W:1 /V /NP /TEE /log:\SERVER_NAMED$ApplicationsMDT_AppSync.log
ping 127.0.0.1 -n 6 > nul
exit

Hope that helps someone.

This topic has been locked by an administrator and is no longer open for commenting.

To continue this discussion, please ask a new question.

Read these next.

Snap! — Holograms, RATs, Inflatable Heat Shields, Drone Swarms, Fake Americans

Your daily dose of tech news, in brief. Welcome to the Snap! Flashback: Back on November 3, 1937, Howard Aiken writes to J.W. Bryce (IBM) about building a «Giant Brain,» which they eventually did (Read more HERE.) Bonus Flashback: Back on Nov.

Spark! Pro series — 3rd November 2022

Today in History: 1883 Black Bart makes his last stagecoach robbery Authorities almost catch the California bandit and infamous stagecoach robber called Black Bart; he manages to make a quick getaway, but drops an incriminating clue that eventually.

HPE MSA or Nimble — Need Advice

I finally might have the budget for next year to refresh my servers.I’m undecided if I should stick with the traditional HPE 2062 MSA array (Dual Controller) with 15k SAS drives or move to a Nimble HF appliance. Here are my questions: Should I go wi.

Aws, Azure, Google cloud

Does anyone know if there are any free training anywhere ?

Department to purchase/deploy laptops & equipment?

I recently started as a remote manager at a company in a growth cycle. In order to keep pace with new hires, the IT manager is currently stuck doing the following: Purchasing laptops & equipment Shipping laptops & equipment to end users after they are.

Источник

17 Replies

  • Author David Rees

    davidr4


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    habanero

    0x2 is usually file not found.  Are you sure that path is correct?


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Zacharry Williams

    Check the event viewer for why it failed. I bet you it’s something silly.


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Ro Ro

    davidr4 wrote:

    0x2 is usually file not found.  Are you sure that path is correct?

    Yup… the .bat is definitely there… see screenshot

    Image: post content


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Ro Ro

    zacharrywilliams wrote:

    Check the event viewer for why it failed. I bet you it’s something silly.

    nothing there unf’…


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Ro Ro

    by the way: the history says «task scheduler successfully finished» 


    Was this post helpful?
    thumb_up
    thumb_down

  • Author David Rees

    davidr4


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    habanero

    Do you have logging enabled in your robocopy script?  It may be returning the 0x2 error


    Was this post helpful?
    thumb_up
    thumb_down

  • Author David Rees

    davidr4


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    habanero

    I really feel like you don’t need those quotes in the path either


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Ro Ro

    davidr4 wrote:

    Do you have logging enabled in your robocopy script?  It may be returning the 0x2 error

    Logging is enabled and when i run it manually outside the task scheduler it completes successfully and creates a log. 


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Ro Ro

    davidr4 wrote:

    I really feel like you don’t need those quotes in the path either

    These are being added automatically when I navigate to the path


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Zacharry Williams

    When you run it, are you using the same creds as the schedule task?


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Ro Ro

    zacharrywilliams wrote:

    When you run it, are you using the same creds as the schedule task?

    yes. I am logged into Windows with Administrator which is the same user which is configured to run the task 


    Was this post helpful?
    thumb_up
    thumb_down

  • Have you checked the box to run with the highest privledges​ in the task scheduler


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Ro Ro

    Phil Adler wrote:

    Have you checked the box to run with the highest privledges​ in the task scheduler

    I have :(


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Ro Ro

    Phil Adler wrote:

    Have you checked the box to run with the highest privledges​ in the task scheduler

    zacharrywilliams wrote:

    When you run it, are you using the same creds as the schedule task?

    davidr4 wrote:

    Do you have logging enabled in your robocopy script?  It may be returning the 0x2 error

    So here’s an interesting one for you all: When i add «pause» at the end of my script that task is being completed successfully. However, it’s not creating the log file. When I run it manually it does.

    Here’s the script:

    robocopy \\nas2\ftp v:\nas2backup\sftp /copyall /e /tee /log:robocopylog.txt
    pause

    thoughts?


    Was this post helpful?
    thumb_up
    thumb_down

  • Author David Rees

    davidr4


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    habanero

    Put a full path in for the log.  C:\scripts\robocopylog.txt

    Maybe the relative path is confusing it


    1 found this helpful
    thumb_up
    thumb_down

  • Author Ro Ro

    davidr4 wrote:

    Put a full path in for the log.  C:\scripts\robocopylog.txt

    Maybe the relative path is confusing it

    That did it! thank you lad!


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Andrew Wiegman

    I realize this thread is old but I found it quite useful at helping me think towards a different solution.

    In case anyone else runs into this issue… I had the same problem and regardless if I used a Remote path, a mapped drive to a remote location or a local drive I was still getting the 0x2 error.
    What I did was simply add a 5 second wait to the end of my batch file before exiting…

    This machine is not on the domain (and in DMZ) syncing with a machine that IS on the domain, hence the added line to create a mapped drive.
    If both your machines are on the same domain the first line isn’t needed.

    if not exist K:\ net use K: \\SERVER_NAME\D$\Applications /user:USERNAME PASSWORD /persistent:no
    robocopy «D:\SoftwareRepository» «K:» /e /xo /Copy:DATSO /FFT /XA:H /R:1 /W:1 /V /NP /TEE /log:\\SERVER_NAME\D$\Applications\MDT_AppSync.log
    ping 127.0.0.1 -n 6 > nul
    exit

    Hope that helps someone.


    3 found this helpful
    thumb_up
    thumb_down

Понравилась статья? Поделить с друзьями:

Интересное по теме:

  • Планировщик задач ошибка 0x1
  • Планшет выдает ошибку подключения
  • Планировщик заданий ошибка удаленный компьютер не найден
  • Планировщик заданий ошибка 0х46
  • Планшет пишет ошибка камеры

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии