博学而笃志 切问而近思 仁在其中
详情
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

上一篇:机器学习目录
下一篇:测试
相关文章
loading......
最新动态
所有评论

loading......

网站声明:
本站部分内容来自网络,如您发现本站内容
侵害到您的利益,请联系本站管理员处理。
联系站长
373515719@qq.com
关于本站:
编程参考手册