Task scheduler 0x41301 code is an error that the reason cannot be easily found. In the following article we will try to fix this issue using some test and checking on your task scheduler. This error appears in all windows versions that use Task Scheduler.
In the “Last run result” column you will see a message “The task is currently running. (0x41301)”. But In fact you are sure that the task need to be finished now.
Read Also: Task Scheduler Error 2147943726 – “unknown user name or bad password”
Understand Task Scheduler 0x41301 code.
Scheduled task 0x41301 triggered after an error or input request appear during running of the task. The option “hidden” has stopped to show the interface in order to get the commands and continue with execution.
To prove this I have done a test, created and simple “.cmd” file where in the end of the command added “Pause” argument. Scheduled to run the bat with “test” task, specified to “run only when user is logged on” and unticked “Hidden” option. After started the task, the command prompt interface has appear and instruct me to type ENTER to continue. With those options seems to be Ok.
I have edited the task, selected the option “run whether user is logged on or not” and ticked the option “Hidden”. The task started and stayed running with the code error 0x41301.
On settings tried to specify “Stop task if it run longer than 5 min” and “If the running task does not end when requested, force it to stop” but the code 0x41301 is not disappear after starting the task.
How to troubleshoot and fix the code 0x41301.
- Check if the account that will run task scheduler is in group “log on as batch job” rights (on server-side). “Control Panel\Admin Tools\Local Security Policy\Local Policies\User Rights Assignments\Log on as a batch job”.
- Fill the “Start In” value in the Actions Tab with the path of the program that you are going to run.
- Run the same command (script or program) manually. Check if the command need interaction from the user.
- Edit the task and set to “run only when user is logged on”. Start the task and check if user interaction needed.
Use the log debugging
The last recommendation is to create log for the task that you are going to run with task scheduler. For example to create log for the “.cmd” file use he example below:
@echo off echo %date% %time% %username% >> c:\test.txt c:\test.cmd 1>>c:\test.txt 2>>&1 echo %date% %time% >> c:\test.txt
Note! Change the path and the name of the script “c:\test.cmd”
Note!! Change the path and the name of the log “c:\test.txt”
Please leave comment if you have any question related to error 0x41301 of Task Scheduler.