I have to run automatically a batch file once a week to update a file. To do so I have created a task with Windows Task Scheduler on the company Server with the following options:
bat
file with quote) This configuration works fine. However I wish the update to happen even if I am not here. So I tried to change to Security Options to:
Trigger and action are unchanged. I have also entered the admin password when saving the task.
On the Task History the action and task are completed, but the bat
file is not run and there is no update happening on my file.
The Last Run Result display:
Incorrect function (0x80070001).
Looking at other posts I have tried different combination:
bat
file with or without quote None of these worked. Any idea?
The code is working fine when activated manually. I am not sure what you mean by the command that start the batch. In the Scheduler it is on the Action tab. The action is start a program and the details is the path to the file ...run.bat When launch manually I right click on the file and select run as administrator.
Thank you in advance for your help. Sylvie
had the same problem with a RScript.exe with batch .R file. Runs perfect with main user, also in command line, but when setting the 'run with different user account' it fails. What I did: added the ScriptUser (an anonymous user that will work forever when I have left the building) to the group Power Users. (Ok, I don't think you are allowed to set it to Administrator). But local\powerusers did it for me. The strange 'Incorrect function' without any details is solved now.
V
I have been having similar issues with a new scheduled task I was setting up. I could run the .exe no problem by itself by clicking on it, but when task scheduler would run it, the app would execute instantly and return a success, but did not actually execute. For us, the solution was to include the Start in folder on the Action tab where you specify the application location. Leaving this value blank will default to the root directory where the most things do not have permission to run.
Task Scheduler Action Settings:
User contributions licensed under CC BY-SA 3.0