Add a new task with the task scheduler using C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to add a new task with the task scheduler using C#? For
instance, if you want to add a program to be run at boot time.
 
| Is there a way to add a new task with the task scheduler using C#? For
| instance, if you want to add a program to be run at boot time.

The easiest way is to issue a schtasks commandline utility command using
System.Diagnostics.Process.Start

Enter:
schtasks /create /?
from the command line for details and sample or search windows help for
schtasks.

Willy.
 
message | The basic stuff can be done with the command line AT but not run on boot
or
| anything like that.
| There is a Win Api for it. A discussion of using it is here:
| http://www.tek-tips.com/viewthread.cfm?qid=356060&page=7
|

You should use schtasks which is a more powerfull superset of the AT
command.
schtasks can create a task that should run at system start (using the
ONSTART modifier).

Willy.
 
Back
Top