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

New Post: How to enable a task in task scheduler using C#?

$
0
0
HI all ,
I am facing a problem, I have a process which is running in task scheduler for some reasons this task STATUS is getting disabled often, so I had to write a program to check this task is running or not, if not I need to set my task Enabled = true; here is the piece of code
  using (TaskService ts = new TaskService())
 {
                bool isEnabled = false;
                
                isEnabled = ts.GetTask("testtask").Enabled; // check task status

                if (isEnabled == false)
                {

                   // __I need to enable testtask__

                }
}
can some one help me on this?

Viewing all articles
Browse latest Browse all 2206

Trending Articles



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