title: How to list scheduled tasks in C#
body: <p>Before anyone says this is a duplicate, I already checked <a href="https://stackoverflow.com/questions/992549/accessing-windows-scheduled-task-using-c-sharp">here</a>, <a href="https://stackoverflow.com/questions/6477693/c-sharp-how-to-list-scheduled-tasks-for-a-specific-user-with-the-taskschedular">here</a>, <a href="https://stackoverflow.com/questions/10026712/how-to-get-the-list-of-scheduled-tasks-using-c">here</a>, <a href="https://stackoverflow.com/questions/9314595/scheduled-task-in-c-sharp">here</a>, and a couple of other resources, including <a href="https://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler(v=vs.110).aspx" rel="noreferrer">MS Task Scheduler Class documentation</a>.</p>
  
  <p>I wanted to be able to list the scheduled tasks on my servers using a C# program I´m developing. Some suggested schtasks.exe MS program, others a <a href="https://www.codeproject.com/Articles/2407/A-New-Task-Scheduler-Class-Library-for-NET" rel="noreferrer">third-party library</a>, which seems old and working only with .NET Framework 2.0 and others the <a href="https://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler(v=vs.110).aspx" rel="noreferrer">MS Task Scheduler Class</a>, which seems to be protected and I´m yet to see some example so I understand how I can use it, and others suggested even reading the XML files in each remote machine under C:\Windows\System32\Tasks folder.</p>
  
  <p>My question is: are tasks in Windows that hard to work with using some VS built-in class? Do I have to jump through hoops in order to do something (kind of) silly like listing the tasks already scheduled in a machine?</p>
  
  <p>Thank you,</p>
  
  <p>EDIT:</p>
  
  <p>I ended up using Process class and started schtasks.exe against all servers. Not exactly what I was looking for but it works. If anyone needs the code, just drop me a line and I post it here. Thanks.</p>