So I have been doing some research on how to programmatically schedule a task, and as of now I haven't really found anything that useful or informative on it. It could be because I am searching for the wrong thing, but thats why I am hoping you guys can help me out.
Here is what I have :
I have a C# Windows Forms Application created in Visual Studio 2013... ideally what I had in mind was to create a button that opens up a form and allows the user to schedule a time and frequency of a task and then set it (if that task already exists, update it).
So I was looking at the ITaskScheduler, but I am really clueless as to how I can use it and implement it. Not sure what assemblies I need to import etc... Was looking at this Link on pinvoke
However, if that cannot be done I am open for any suggestions. I am experienced in C/C++, and I know I have seen a few methods for C++ but nothing that looked very promising.
Here is the alternative I was thinking :
Simply just create a different program and then just schedule the .exe
to run when I want.
- As of now I am leaning heavily towards this method, but I am relatively new to programming in Visual Studio. However, I am an experienced programmer.
- My question on this is... what would be the preferred method of creating this program? Would it be creating a Windows Form Application or a Console Application or just a plain empty project with a
Main()
method
So if you guys can shed some light on this subject for me that would be greatly appreciated.