1.

How Can I Create A Process That Is Running A Supplied Native Executable (e.g., Cmd.exe)?

Answer»

<P>The following code should run the executable and wait for it to exit before continuing:
using System;
using System.Diagnostics;
public CLASS ProcessTest {
public static VOID Main(string[] args) {
Process p = Process.Start(args[0]);
p.WaitForExit();
Console.WriteLine(args[0] + " exited.");
}
}
Remember to add a REFERENCE to System.Diagnostics.dll when you compile.

The following code should run the executable and wait for it to exit before continuing:
using System;
using System.Diagnostics;
public class ProcessTest {
public static void Main(string[] args) {
Process p = Process.Start(args[0]);
p.WaitForExit();
Console.WriteLine(args[0] + " exited.");
}
}
Remember to add a reference to System.Diagnostics.dll when you compile.



Discussion

No Comment Found