You might sometimes get a corrupt task error popup when you open the Task Scheduler. The error popup reads “Task <etc..>: The task image is corrupt or has been tampered with”.
It looks like this error will be difficult to fix, the key to fixing it is found by locating the specific task xml file in question, and deleting it.
This fixes the error, but now you will not have that task anymore which could be a problem.
The first part of this article goes into detail on how to fix the error, and the second part goes into detail on how to obtain and restore an non-corrupted version of the task in question.
Read below for the details.
Part One: Fix the Corrupt Task error.
In order to fix this, you have to delete the actual task XML file that contains the task settings, then rerun the Task Scheduler to confirm that the error is gone.
Most of the work you have to do is to locate the task file in question.
The task files are located in C:\Windows\System32\Tasks.
If you try to open the task folder, you might get a UAC prompt asking you for permission to access the folder, this is OK, just click continue to access the folder.
In my case, the corrupt task was “Microsoft-Windows-DiskDiagnosticDataCollector“.
This was a Microsoft task, therefore I had to go into the C:\Windows\System32\Tasks\Microsoft\Windows\DiskDiagnostic folder to locate the actual task xml file,
which was named “Microsoft-Windows-DiskDiagnosticDataCollector” as shown below.
Back up and delete the corrupt task
Once you have located the task file, close the task scheduler, back up the corrupted task file to any location of your choice, then delete it, then open the task scheduler to confirm that the error has gone.
OK, that has resolved the error, but now that task has been deleted, and it might be needed by the system or by one of your programs.
So the above steps are only a partial solution, To fix the remaining issue, see part two below.
Part Two: Import a non-corrupted version of the task into the Task Scheduler.
OK, if you have followed me this far without any problems, then you are doing well.
What you now need to do is to export the non-corrupted task from another computer or virtual machine, and import it into the task scheduler.
To export the task in question from another computer, follow these steps.
1. Open the Task Scheduler, then drill down into the task in question, then right-click on the task and select “Export...” as shown below.
Export the task from a different computer
2. Save the exported XML file to a location of your choosing, then copy it over to the affected computer.
3. Once you are back on the affected computer, make sure that the task scheduler is closed, then you need to run the task scheduler as an Administrator.
4. To run the task scheduler as an Administrator, click Start>All Programs>Accessories>System Tools, then locate “Task Scheduler“, right-click it and select “Run as Administrator” as shown below.
Run the task scheduler as Administrator
5. Once the task scheduler is open, drill down to the folder where the task is supposed to be located, right-click on a blank portion of the window, and select “Import Task…” as shown below.
Selecting "Import Task"
6. Once you have imported the task, a “Create task” window will open as shown below, just click OK to it.
Click OK on the "Create Task" window.7.
7. The task should then be successfully imported as shown below, you can then close the task scheduler, and the problem should be fully resolved.
Successfully imported task.
If the problem is still not resolved, or if you are having trouble finding the specific task, then leave a comment below, and I will try my best to help you fix the issue.