Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article helps resolve the issue in which your scheduled tasks fail to run with error "Task schedular service is not available."
Some of your scheduled tasks fail to run. When you open Task Scheduler to investigate the failure, you receive the following error message:
Task schedular service is not available. Task Scheduler will attempt to reconnect to it.
This issue is caused by the following reasons:
- Incorrect scheduled task configurations.
- Scheduled task target application or script is no longer available or valid.
- Incompatible scheduled tasks after recent operating system (OS) upgrade.
Use the following steps to resolve the issue:
- Clean up
attasks if they exist. - Delete corrupted tasks and then create them again if needed.
Step 1: Clean up at tasks if they exist
Note
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 might affect the successful launch of Task Scheduler.
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:
C:\Windows\System32\Tasks
- C:\Windows\System32\Tasks\At1
- C:\Windows\System32\Tasks\At2
C:\Windows\Tasks
- C:\Windows\Tasks\At1.job
- C:\Windows\Tasks\At2.job
To resolve this issue, clean up the legacy tasks by using the following steps:
Important
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For protection, back up the registry before you modify it so that you can restore it if a problem occurs. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.
Stop the Task Scheduler service:
Download PsTools and extract the file.
Go to the extracted PsTools directory and run the following command from an administrative Command Prompt (cmd.exe) window:
psexec.exe -s -i cmd.exeAfter you accept the end-user license agreement (EULA), another cmd.exe process opens. Type
whoamiin the command prompt, and you should receive the outputnt authority\system.Run this command:
net stop schedule
After the Task Scheduler service is stopped successfully, delete the files for
attasks after backup if they exist. Here are some examples:C:\Windows\System32\Tasks
- C:\Windows\System32\Tasks\At1
- C:\Windows\System32\Tasks\At2
C:\Windows\Tasks
- C:\Windows\Tasks\At1.job
- C:\Windows\Tasks\At2.job
Clear the schedule entries from the registry:
Open Registry Editor as administrator.
Go to
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks, and back up theTasksfolder before proceeding with the next steps.Delete the keys ending in
{1},{2},{3}… or more if they exist. Those keys have the propertyPathset to\\At<#>, for example:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{1}Path=\\At1HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{2}Path=\\At2
Delete the following keys if they exist:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{xxxxxxxx-EC79-4064-9831-xxxxxxxxxxxx}HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{xxxxxxxx-FB9E-4BDD-8FED-xxxxxxxxxxxx}
Go to
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree, and delete the keys ending inAt1,At2,At3… or more if they exist. Those keys end withAt<#>, for example:Important
Back up the
Treekey before proceeding with the next steps.HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\At1HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\At2
Go back to the command prompt opened using the
psexeccommand, and then run the following command to start the Task Scheduler service:netsh start schedule
Step 2: Delete corrupted tasks and then create them again if needed
If you clean up the at tasks or you don't have at tasks, you might have corrupted tasks that cause this issue. Find the corrupted tasks, delete them, and then create them again if needed.
Find the corrupted tasks:
Open Task Scheduler, and acknowledge the first error message to get into the Task Scheduler console.
Expand the Task Scheduler Library structure.
Select each folder object and observe if any of them produce the following error message:
The selected task "{0}" no longer exists. To see the current tasks, click Refresh.
Take a note of each task that produces this error message.
Once you go through all folders and subfolders within Task Scheduler, you're ready to delete the corrupted tasks.
Delete the corrupted tasks:
Important
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For protection, back up the registry before you modify it so that you can restore it if a problem occurs. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.
Note
Before you proceed with the following steps, back up the following items:
- The folder %SYSTEMDRIVE%\Windows\System32\Tasks
- The registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\
Delete the task file that corresponds to the corrupted task from the Tasks folder (%SYSTEMDRIVE%\Windows\System32\Tasks).
Go to the registry subkey
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree. Note down theIdvalue (in GUID format) of each task that needs to be deleted corresponding to the corrupted task.Delete the registry subkey that corresponds to the corrupted task from
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree.
Delete the registry subkey that corresponds to the corrupted task from
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks.Delete the registry subkey that corresponds to the corrupted task from one of the following locations:
Note
The task exists in only one of the three locations and is in GUID format.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\PlainHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\LogonHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Boot
Contact Microsoft Support
If the preceding steps can't resolve the issue, contact Microsoft Support for further assistance.