Task Scheduler Error and Windows 7 Defrag

If I set Disk Defragmenter to run monthly then I open Task Scheduler a  warning window appears stating "The selected task "(0)" no longer exists. To set the current tasks click refresh". If I close the window and click refresh the warning window just appears again.  If I re-set Defrag to weekly the problem is solved.  So what is this all about? I only want to Defrag once a month.  Is this a known problem?  Can anyone help please? 
 

Question Info


Last updated August 28, 2019 Views 9,265 Applies to:
Answer
Answer

Found a fix.

Go into your registry and delete the following key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache

 

Please make sure you backup the key before deleting.  If you're not sure how to do this I don't recommend doing it.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Answer
Answer

If Event Viewer lists more than one faulting task (see below), definitely try the Registry edit first (always launch the Registry after selecting Run as administrator).  Then, delete key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache).  If wary, export the key (right click and choose Export) to a registration file named TaskCache.reg beforehand and if dissatisfied afterwards, merely double click it to restore the database to its former state.

 

Otherwise:

 

Deleting Task Scheduler's underlying XML files, found in the subfolders of path …\Windows\System32\Tasks\Microsoft\Windows, definitely does the trick!  However, to streamline the discovery process, use Task Scheduler's Operational log in Event Viewer to locate any "Task loading at service startup failed" errors, easily identifiable in the Level column.  The log's entries are displayed by selecting file Operational in folder Event Viewer (local)\Applications and Services logs\Microsoft\Windows\TaskScheduler from the navigation pane.  Don't forget to sort the list by clicking on the Level column header.  Perfect!  But what about restoring those tasks, and preferably not by hand?  Since they won't open in Task Scheduler anymore, open them in WordPad to check out their XML (don't forget to type * in the Filename textbox, then Enter, to display a non-WordPad file in its Open dialog; or use All Docs (*.*) in the dropdown list) to decide whether it's worth the effort to manually recreate the task after deleting the file.  Wow!  That sounds like an awful lot of work, especially if there is more than one task "(0)".  Other than the subfolders, where is a list of all the prefabricated tasks, and better yet, where oh where can the XML files that constitute them be found to download?  Oh, the humanity!

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.