The purpose
I noticed in mid-May 2023 that a scheduled task on Windows 11 has been failing.
I haven’t edited the task or the files it executes, but it started failing recently. If you have any custom tasks in Task Scheduler, I recommend checking if they are running correctly.
Tasks that fail
The tasks that failed were as follows
task | bat file |
Last result (Error code) | 0x1 |
Additional argument | > log.txt output log |
Start | folder has bat will be started |
Workaround
The cause this time was the argument “> log.txt”.
Removing the argument fixed the issue.
I suspected the issue was that the file path wasn’t absolute, so I tried using an absolute path, but that didn’t resolve the problem.
If you absolutely need the same behavior, I recommend creating a new batch file and running the original batch file from within the new one using output redirection in the execution task.
comment