I wish to execute an exe program from a winforms button. I am using the below code which works. The problem is the winform goes into a blocked state and I cannot interact with it until the exe program is closed. I would like to interact with both the winform and the executed program.
How can I make the executed program non-modal?
public static void ExecuteCommand(string workingDirectory,
string cvsExePath, string arguments)
{
ProcessStartInfo exeProcess = new ProcessStartInfo(cvsExePath
, " " + arguments.Trim());
exeProcess.WorkingDirectory = workingDirectory;
exeProcess.UseShellExecute = false;
exeProcess.RedirectStandardOutput = false;
exeProcess.RedirectStandardError = true;
exeProcess.CreateNoWindow = false;
Process proc = Process.Start(exeProcess);
}
You should create a thread and the thread execute this exe
this is how to create threads :
How to: Create and Terminate Threads (C# Programming Guide)