Well, I suppose you don't know about the schtasks
command.
You could simply open a command prompt and type schtasks /?
to see the options available.
The one needed here is /create
. Of course this option requires a series of parameter to configure your scheduled task. But at the end you could resolve all calling:
Process.Start("schtasks", commandParams);
For the close process part, I use a little utility called pskill
found in the Sysinternals suite from Microsoft's Mark Russinovich. Also this could be called inside a batch file set as scheduled task.
EDIT: Changed from psshutdown to pskill (You need to close only your app right?)