I am trying to create an app that will perform actions on specific times (much like the Windows Task Scheduler). I am currently using Process.Start() to launch the file (or exe)
Process.Start(string,string) returns you a Process resource that you can use to further control the new process.
Process newProcess = Process.Start("param1", "param2");
if (newProcess != null && !newProcess.HasExited)
newProcess.Kill();
The same structure works if you use Process.Start(string)
, or any other static Process.Start overload.
Process.Start()
is a member function and associates a new or reused Process
with the Process
component identified by this. Behaviour of this method depends on the properties of the Process identified by this
.