Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

New Post: How to get the last run time of a specific task

$
0
0
This is what i have tried but i have a few question to ask
1) Where do we get the taskpath from ? The scheduler is running an application every 1 hour. Is the path equals to the path of the application ?

2)Can i get the last run time exactly like the one displayed in the windows task scheduler because i did not create a task dynamically using this library

string lastruntime;
using (TaskService ts = new TaskService())
{
    Microsoft.Win32.TaskScheduler.Task task = ts.GetTask(@"C:\Program Files     (x86)\Google\Update\GoogleUpdate.exe");
    if (task!= null)
    {
           lastruntime = task.LastRunTime.ToString();
     }
}

Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>