Since my last post, I had the opportunity to explore this problem further, and think I've found the root cause:
Briefly, I believe the cause of the problem is mal-formed sceduled tasks. It appears to me that each task must have the machine name as well as the user name in the task. E.g., if my computer's name is ''MYPC'', and my user name is ''Ablank'', then each task must have a UserID of ''MYPC\Ablank'', not just ''Ablank''. If even one task lacks the machine name, none of the tasks show up in CCleaner, and not all show up in Task Scheduler. The problem then becomes how to find the missing tasks and how to correct them, if you can't see them!
On a Windows 7 (32 bit) PC, the tasks can be found in C:\Windows\Tasks (job files) and C:\Windows\System32\Tasks (task files). The 'task files' are in XML format, but there is no file extension on those files in the ...\System32\Tasks folder. They can be copied to a work folder, however, edited with a text editor to correct the <UserId>.....<UserId> line, and renamed to .xml files. For example, using the names in the paragraph above, the UserID line should appear as follows:
<UserId>MYPC\Ablank</UserId>
All relevant files then have to be deleted from both 'Tasks' folders, and then re-imported into Task Scheduler from the modified XML files. But complications arise if the task names still exist in the registry, preventing successful importing of the XML files! It then becomes necessary to search for and delete all registry keys with the tasks' names using the Registry Editor, Regedit.exe.
The keys where most of these old task names can be found in the registry are as follows:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks
(Find the task name in the right-hand panel, and delete the corresponding key in the left-hand panel. For example, CCleaner's task "CCleanerSkipUAC" can be found twice in this section.)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree
(Find the task name as a key in the left hand panel, and delete it; don't delete 'Microsoft', of course! For example, CCleaner's task "CCleanerSkipUAC" can be found once in this section.)
Once the XML files and cleaned up with the proper UserID and the task names deleted from the registry, one should be able to successfully import the tasks into Task Scheduler. (Click on 'Task Scheduler Library' in the left pane of Task Scheduler, then right click in the center pane, and select "Import Task" from the context menu, and navigate to the .xml file of the proper name, that you modified in the step above. Once the import begins, the Properties of the new task will appear in a window. Verify that in the "General" tab, the UserID you used above appears just below the label "When running the task, use the following user account:", both the {Machine Name}\{User Name}, e.g., "MYPC\Ablank" (no quotes). (Note the use of the backslash, "\", separating the two names.) If there is a problem with the import, it will probably be due to a duplicate name you missed somewhere in the registry, or to a .job file that exists with that name in C:\Windows\Tasks. Find the offending files and/or registry entries, and delete them, as described above, then try to import the .xml file into Task Scheduler again. Eventually, it (hopefully) will import successfully.
Once imported in this manner, all tasks should appear correctly in both CCleaner and in Task Scheduler. I've done this with success on two Windows 7 systems, so I'm fairly confident that I've solved the problem, though I might be wrong on some relevant details, as the Task Scheduler process is a complex one!
aboutblank
September 10, 2014