The task scheduler error 0x1 is the most common error I see with microsoft windows scheduled tasks.
I have seen it on many microsoft windows computers and servers at my work. I have fixed this error many times and the fix is always the same or very similar.
What Causes The Task Scheduler (0x1) Error?
The error code (0x1) in a scheduled task means, Incorrect function called or unknown function called. This is usually caused by a microsoft windows path issue in the scheduled task.
Sometimes the task will run and complete successfully but the task will not have actually done what you needed to do, I will go through the fixes below.
How To Fix Task Scheduler (0x1) Error in Windows
To fix the error 0x1 you need to enter a path in the “Start in (optional)” field in the edit action part of the scheduled task. This will help microsoft windows to run the task in the correct system path.
To do this follow these steps
- Open task scheduler by clicking start and typing in “Task Scheduler” and click on the app
- Click task scheduler library
- Right click on the required task and select properties
- Click the actions tab
- Click edit
- In the Start in (Optional) field type in the required path
- If you are not sure what the correct path should be copy the path minus the process from the Program/Script field
- In the example below I put c:Program FilesMicrosoft Security Client
- Click OK to close the edit action screen
- Click OK to close the scheduled task
- Re-run the scheduled task again
- If you see the last run result is 0x0 then this means the task ran successfully
The below video also shows you the above process
How To Fix Task Scheduler (0x1) Error When Running Batch Files
To fix the error 0x1 when running batch files in a task scheduler you need to enter a path in the “Start in (optional)” field in the edit action part of the scheduled task.
You get the error 0x1 when a task scheduler is running a batch file because it can not find a file. In the example below I am running the following scheduled task
- Task Name : Test Batch File
- Program/script : C:DataRobocopy.cmd
- Start in (Optional) : blank
Robocopy.cmd contents (FYI Robocopy.exe is located in C:Data folder)
Robocopy.exe “C:DataFiles” “D:Backup%DATE%”
When a scheduled task runs if the “Start in (Optional)” field has not been filled out it will use the microsoft windows default path of C:WindowsSystem32. The issue with this is that it will not find the robocopy.exe file to start the file copy.
So there are a few fixes here
- Open task scheduler by clicking start and typing in “Task Scheduler” and click on the app
- Click task scheduler library
- Right click on the required task and select properties
- Click the actions tab
- Click edit
- In the Start in (Optional) field type in the required path (In the above example it will be C:Data
You could also copy the robocopy.exe file to C:WindowsSystem32 folder or update the Robocopy.cmd with the full path to the .exe as per below
C:DataRobocopy.exe “C:DataFiles” “D:Backup%DATE%”
How To Fix Task Scheduler (0x1) Error When Running Powershell Scripts
To fix the error 0x1 when running powershell scripts in task scheduler you need to set the execution policy to bypass in the task scheduler arguments.
To do this follow these steps
- Open task scheduler by clicking start and typing in “Task Scheduler” and click on the app
- Click task scheduler library
- Right click on the required task and select properties
- Click the actions tab
- Click edit
- In the “Program/script” field type in powershell.exe
- In the “Add arguments” field enter -ExecutionPolicy Bypass -File “C:DataScript.ps1”
- In the Start in (Optional) field type in the path of where the powershell script is located C:Data
Frequently Asked Questions
The error 0x1 will appear in the last run result in a task scheduler if it had an issue running the task. It will have an issue where is can not find a required file, This is usually resolved by setting the start in path within the scheduled task.
The return code 2147942401 means that there is an error in the action argument in the scheduled task. The action argument field should be in the format -ExecutionPolicy Bypass -File “C:DataScript.ps1”
Yes they are the same error code. 0x1 will always show in microsoft windows task scheduler, 0x01 will show in other applications depending on what the programmer put in the code to show the error
Hello, I am the owner of this site. I have 25+ years experience of IT. Check us out on the below social platforms.