Friday, August 12, 2011

How to close the cmd.exe progress in C#


currentCommand = programPath + "\\ShotSegmentation.exe " + videoPath + "\\" + currentVideoFile + " " + outputPath + "\\" + currentOutputFile;

                    //MessageBox.Show(currentCommand);

                    proc = new Process();
                    proc.StartInfo.CreateNoWindow = true;
                    proc.StartInfo.UseShellExecute = false;
                    proc.StartInfo.RedirectStandardOutput = true;

                    proc.StartInfo.RedirectStandardError = true;
                    proc.StartInfo.FileName = "cmd.exe";

                    proc.StartInfo.Arguments = "/C " + currentCommand;                  

                    proc.Start();
                    string output = proc.StandardOutput.ReadToEnd();
                    proc.WaitForExit();

No comments:

Post a Comment