G
gizmo
I have a requirement to initiate more than one instance of an
application using the filenames. (the example below will start two
instances of MS Word).
My problem is that I need to kill each instance individually, but this
does not appear possible using the Process object. When I run the
example below the process object "p" can be viewed using Quick Watch
however process object p2 is displayed as undefined, with the added
affect of not being able to kill instance p2.
-Code----------------------------------------------
ProcessStartInfo startInfo = new ProcessStartInfo("a.doc");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
Process p = Process.Start(startInfo);
......
ProcessStartInfo startInfo2 = new ProcessStartInfo("b.doc");
startInfo2.WindowStyle = ProcessWindowStyle.Minimized;
Process p2 = Process.Start(startInfo2);
....
p.Kill();
....
p2.Kill();
-End Code----------------------------------------------
Does anyone have an explanation for this?
Is there another way of doing it?
Regards
Gavin
application using the filenames. (the example below will start two
instances of MS Word).
My problem is that I need to kill each instance individually, but this
does not appear possible using the Process object. When I run the
example below the process object "p" can be viewed using Quick Watch
however process object p2 is displayed as undefined, with the added
affect of not being able to kill instance p2.
-Code----------------------------------------------
ProcessStartInfo startInfo = new ProcessStartInfo("a.doc");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
Process p = Process.Start(startInfo);
......
ProcessStartInfo startInfo2 = new ProcessStartInfo("b.doc");
startInfo2.WindowStyle = ProcessWindowStyle.Minimized;
Process p2 = Process.Start(startInfo2);
....
p.Kill();
....
p2.Kill();
-End Code----------------------------------------------
Does anyone have an explanation for this?
Is there another way of doing it?
Regards
Gavin