Before anyone says this is a duplicate, I already checked here, here, here, here, and a couple of other resources, including MS Task Scheduler Class documentation.
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 third-party library, which seems old and working only with .NET Framework 2.0 and others the MS Task Scheduler Class, 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.
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?
Thank you,
EDIT:
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.
TaskScheduler.Current
is static and public, as isTaskScheduler.Default
. The constructor is intended to be used only by derived classes. In any case, that class does not appear to be an interface to the operating system's list of scheduled tasks. – Baste