C#调用cmd命令执行msi安装文件
作者:Aliot
发布时间:2018-11-14
评论:0
阅读:11
------------------------------------------------------------------------------------
string strInput = @"msiexec /i D:\Install.msi /qb";
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine(strInput + "&exit");
p.StandardInput.AutoFlush = true;
string strOuput = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
---------------------
作者:十四贝勒
来源:CSDN
原文:https://blog.csdn.net/thanks_hck/article/details/78506844