【Recommended for confirmation】Tasks in Task Scheduler are failing on Windows 11

This article can be read in about 2 minutes.
PR

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.

PR

Tasks that fail

The tasks that failed were as follows

taskbat file
Last result
(Error code)
0x1
Additional argument> log.txt
output log
Startfolder has bat will be started
PR

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

Copied title and URL