Skip to content

Commit fc5cb34

Browse files
author
Simonx Xu
committed
New Article Request: Task Scheduler service is not available
1 parent a33b068 commit fc5cb34

2 files changed

Lines changed: 148 additions & 0 deletions

File tree

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
title: Scheduled tasks fail with error "Task schedular service is not available"
3+
description: Helps resolve the error in which scheduled tasks fail with the error "Task schedular service is not available."
4+
manager: dcscontentpm
5+
ms.date: 04/07/2025
6+
ms.topic: troubleshooting
7+
ms.reviewer: kaushika, warrenw, v-lianna
8+
ms.custom: sap:Task Scheduler
9+
---
10+
# Scheduled tasks fail with error "Task schedular service is not available"
11+
12+
This article helps resolve the issue in which your scheduled tasks fail to run with error "Task schedular service is not available."
13+
14+
Some of your scheduled tasks fail to run. When you open Task Scheduler to investigate the failure, you receive the following error message:
15+
16+
> Task schedular service is not available. Task Scheduler will attempt to reconnect to it.
17+
18+
This issue is caused by the following reasons:
19+
20+
- Incorrect scheduled task configurations.
21+
- Scheduled task target application or script is no longer available or valid.
22+
- Incompatible scheduled tasks after recent operating system (OS) upgrade.
23+
24+
Use the following steps to resolve the issue:
25+
26+
1. Clean up `at` tasks if they exist.
27+
2. Delete corrupted tasks and then create them again if needed.
28+
29+
## Step 1: Clean up at tasks if they exist
30+
31+
> [!NOTE]
32+
> [At](/windows-server/administration/windows-commands/at) tasks refer to tasks scheduled to run automatically by the OS using the `at` command. It's a legacy command in Windows for scheduling tasks at specified time and date. These tasks are managed by the Task Scheduler service. After an OS upgrade, such tasks might fail due to compatibility issues or problems with the Task Scheduler service. This could affect the successful launch of Task Scheduler.
33+
34+
Check the **C:\Windows\System32\Tasks** folder to determine if you have any `at` tasks created under Task Scheduler. If so, the tasks are listed under the following locations. For example:
35+
36+
- **C:\Windows\System32\Tasks**
37+
- **C:\Windows\System32\Tasks\At1**
38+
- **C:\Windows\System32\Tasks\At2**
39+
40+
- **C:\Windows\Tasks**
41+
- **C:\Windows\Tasks\At1.job**
42+
- **C:\Windows\Tasks\At2.job**
43+
44+
To resolve this issue, clean up the legacy tasks by using the following steps:
45+
46+
[!INCLUDE [Registry important alert](../../includes/registry-important-alert.md)]
47+
48+
1. Stop the Task Scheduler service:
49+
50+
1. Download [PsTools](/sysinternals/downloads/pstools) and extract the file.
51+
2. Go to the extracted PsTools directory and run the following command from an administrative Command Prompt (**cmd.exe**) window:
52+
53+
`psexec.exe -s -i cmd.exe`
54+
55+
3. After you accept the end-user license agreement (EULA), another **cmd.exe** process opens. Type `whoami` in the command prompt, and you should receive the output `nt authority\system`.
56+
4. Run this command:
57+
58+
`net stop schedule`
59+
60+
2. After the Task Scheduler service is stopped successfully, delete the files for `at` tasks after backup if they exist. Here are some examples:
61+
62+
- **C:\Windows\System32\Tasks**
63+
- **C:\Windows\System32\Tasks\At1**
64+
- **C:\Windows\System32\Tasks\At2**
65+
66+
- **C:\Windows\Tasks**
67+
- **C:\Windows\Tasks\At1.job**
68+
- **C:\Windows\Tasks\At2.job**
69+
70+
3. Clear the schedule entries from the registry:
71+
72+
1. Open Registry Editor as administrator.
73+
2. Go to `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks`, and back up the `Tasks` folder before proceeding with the next steps.
74+
3. Delete the keys ending in `{1}`, `{2}`, `{3}` … or more if they exist. Those keys have the property `Path` set to `\\At<#>`, for example:
75+
76+
- `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{1}`
77+
78+
`Path`=`\\At1`
79+
80+
- `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{2}`
81+
82+
`Path`=`\\At2`
83+
84+
4. Delete the following keys if they exist:
85+
86+
- `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{xxxxxxxx-EC79-4064-9831-xxxxxxxxxxxx}`
87+
88+
- `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{xxxxxxxx-FB9E-4BDD-8FED-xxxxxxxxxxxx}`
89+
90+
5. Go to `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree`, and delete the keys ending in `At1`, `At2`, `At3` … or more if they exist. Those keys end with `At<#>`, for example:
91+
92+
> [!IMPORTANT]
93+
> [Back up](https://support.microsoft.com/topic/855140ad-e318-2a13-2829-d428a2ab0692) the `Tree` key before proceeding with the next steps.
94+
>
95+
> - `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\At1`
96+
>
97+
> - `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\At2`
98+
99+
4. Go back to the command prompt opened using the `psexec` command, and then run the following command to start the Task Scheduler service:
100+
101+
`netsh start schedule`
102+
103+
## Step 2: Delete corrupted tasks and then create them again if needed
104+
105+
If you have cleaned up the `at` tasks or you don't have `at` tasks, you might have corrupted tasks that causing this issue. Find the corrupted tasks, delete them and then create them again if needed.
106+
107+
1. Find the corrupted tasks:
108+
109+
1. Open Task Scheduler, and acknowledge the first error message to get into the Task Scheduler console.
110+
2. Expand the Task Scheduler Library structure.
111+
3. Select each folder object and observe if any of them produce the following error message:
112+
113+
> The selected task "{0}" no longer exists. To see the current tasks, click Refresh.
114+
115+
4. Take a note of each task that produces this error message.
116+
5. Once you've gone through all folders and subfolders within Task Scheduler, you're ready to delete the corrupted tasks.
117+
118+
2. Delete the corrupted tasks:
119+
120+
[!INCLUDE [Registry important alert](../../includes/registry-important-alert.md)]
121+
122+
> [!NOTE]
123+
> Before you proceed with the following steps, back up the following items:
124+
>
125+
> - The folder **%SYSTEMDRIVE%\Windows\System32\Tasks**
126+
> - The registry key `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\`
127+
128+
1. Delete the task file that corresponds to the corrupted task from the Tasks folder (%SYSTEMDRIVE%\Windows\System32\Tasks).
129+
2. Go to the registry subkey `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree`. Note down the `Id` value (in GUID format) of each task that needs to be deleted corresponding to the corrupted task.
130+
131+
Delete the registry subkey that corresponds to the corrupted task from `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree`.
132+
133+
3. Delete the registry subkey that corresponds to the corrupted task from `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks`.
134+
135+
4. Delete the registry subkey that corresponds to the corrupted task from one of the following locations:
136+
137+
> [!NOTE]
138+
> The task exists in only one of the three locations and is in GUID format.
139+
>
140+
> - `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Plain`
141+
> - `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Logon`
142+
> - `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Boot`
143+
144+
## Contact Microsoft Support
145+
146+
If the preceding steps can't resolve the issue, contact Microsoft Support for further assistance.

support/windows-client/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,8 @@ items:
10331033
href: ./system-management-components/0x80041323-running-scheduled-tasks.md
10341034
- name: Run programs automatically when a user logs on
10351035
href: ./system-management-components/run-programs-automatically.md
1036+
- name: Scheduled tasks fail with "Task schedular service is not available"
1037+
href: ./system-management-components/task-schedular-service-is-not-available.md
10361038
- name: Task scheduler runs tasks as background processes
10371039
href: ./system-management-components/task-scheduler-task-only-runs-in-background.md
10381040
- name: Use the at command to schedule tasks

0 commit comments

Comments
 (0)