schtasks /query /fo LIST /v

to display the properties of the tasks. One of the properties is the last run field. If you could input the results of the query above and last result field.

The command uses the /s parameter to identify the remote computer, Reskit16,
the /fo parameter to specify the format and the /nh parameter to suppress
the column headings. The >> append symbol redirects the output to the task
log, p0102.csv, on the local computer, Svr01. Because the command runs on
the remote computer, the local computer path must be fully qualified.

schtasks /query /s Reskit16 /fo csv /nh >> \\svr01\data\tasklogs\p0102.csv



Checking the Task Status

Periodically check the status of scheduled tasks, because sometimes you may not be aware that a scheduled task did not run. Use the Detail view in the Scheduled Task window to see the following information about each task:

  • Schedule – The schedule for the task.
  • Next Run Time – The time and date that the task is next scheduled to run.
  • Last Run Time – The time and date the task was last run.
  • Status – The current status of the task.
  • Last Result – Code that indicates the result of the last run.

The Status column has the following status and description information:

  • Blank – The task is not running, or it ran and was successful.
  • Running – The task is currently running.
  • Missed – One or more attempts to run this task was missed.
  • Could not start – The most recent attempt to start the task did not work.

The Last Result column displays a completion code. You can obtain a full explanation of all Windows completion codes from MSDN, but the common codes for scheduled tasks are:

  • 0x0: The operation completed successfully.
  • 0x1: An incorrect function was called or an unknown function was called.
  • 0xa: The environment is incorrect.

Here is the Microsoft Page explains “How to troubleshoot scheduled tasks in Windows XP and in Windows Server 2003