Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you verify that a scheduled task exists on a server using C#?

also how can you tell if it is running, enabled/disabled, etc.?

like image 472
KevinDeus Avatar asked Aug 06 '09 22:08

KevinDeus


People also ask

How can I tell if a Scheduled Task is running?

Right-click the Task Scheduler service, and then click Properties. On the General tab, make sure that the startup type is set to automatic, and that the service status is Started. If the service is not running, click Start.

What command can you use to see list of Scheduled Tasks running on your computer?

To view a list of tasks that you scheduled by using the at command, type the at \\computername line, and then press ENTER. To view a specific scheduled task, type the at \\computername id command, and then press ENTER.


1 Answers

There is a Task Scheduler API that you can use to access information about tasks. (It is a com library, but you can call it from C# using pinvokes)

There is an article on codeproject that provides a .net wrapper for the API.

[There is also the schtasks command - more info]

like image 157
Simon P Stevens Avatar answered Sep 26 '22 21:09

Simon P Stevens