Schedule Task Last Run Result 0x2

33,485

Solution 1

I resolved the issue by calling the batchfile under "Program/Script" & set the complete absolute path in "Start In (optional):" box like below:

Program/Script: Process.cmd
Start In (optional): T:\Processing\clients\myTest

Hope this helps.

Solution 2

Another option as described here: Run .bat in Task Scheduler

Program/Script: T:\Processing\clients\myTest.bat
Start In (optional): T:\Processing\clients\
Share:
33,485

Related videos on Youtube

artabaz
Author by

artabaz

Updated on September 18, 2022

Comments

  • artabaz
    artabaz over 1 year

    I have a scheduled task running on Windows 7 and it returns 0x2 (according to this article, it means "access denied" and according to this article it means "an issue with the file") every time is runs.

    The scheduled task runs a .BAT file. The task is set with highest privileges. The .BAT file runs successfully from the CMD.

    most links in those articles are deprecated, any idea how to solve this issue?

    • ejbytes
      ejbytes about 7 years
      Not sure what exactly type of batch file you are running. But if you use a shortcut of the batch file and use full paths, you can use the shortcut in the properties (via right click) run as admin. This might help. Another problem I recently ran into with a similar error, also running a batch, I went into the folder(directory of targeted files from batch) properties and increased authority to my logged-in user.
    • Seth
      Seth about 7 years
      According to the official list and running net helpmsg 2 the task scheduler can't find the file you specified. This might also be reported by the batch itself if I'm not mistaken.
    • DavidPostill
      DavidPostill about 7 years
      Are you running the batch file in the correct directory?
    • artabaz
      artabaz about 7 years
      Yes, the batch file is in the correct directory, I can run it manually. Also it has the highest previlage, I am also the admin and it is using highest authority. I noticed something, Once I am adding in a log using "Add Arguments" option (> failure.log), the result changes to 0x1 instead of 0x2.
    • artabaz
      artabaz about 7 years
      thank you @Seth for the current list and helpful command.
    • Aakash Maurya
      Aakash Maurya over 5 years
      Can we trigger any email action when we receive 0X2 in task scheduler?
    • artabaz
      artabaz over 5 years
      @AakashMaurya I thought of same thing; I couldn't do find a way ot doing it though.