var outputBuilder = new StringBuilder(); var processStartInfo = new ProcessStartInfo(); processStartInfo.CreateNoWindow = true; processStartInfo.RedirectStandardOutput = true; processStartInfo.RedirectStandardError = true; processStartInfo.RedirectStandardInput = true; processStartInfo.UseShellExecute = false; processStartInfo.Arguments = "/b " + @"C:\AutoInstaller\myApp.bld"; processStartInfo.FileName = @"C:\Program Files (x86)\VisBuildPro8\VisBuildCmd.exe"; processStartInfo.Verb = "runas"; var process = new Process(); process.StartInfo = processStartInfo; process.EnableRaisingEvents = true; process.OutputDataReceived += delegate(object sender, DataReceivedEventArgs e) { outputBuilder.Append(e.Data); outputBuilder.Append(Environment.NewLine); }; process.Start(); process.BeginOutputReadLine(); process.WaitForExit(); process.CancelOutputRead();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)