本文介绍了如何通过C#打开cmd并执行.exe文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我想通过C#打开cmd,然后要更改cmd中的目录并执行一些.exe文件.

hi every body
i want to open cmd via c# and then want to change the directory in cmd and execute some .exe file.

Process p = new Process();
        string result = "";

        p.StartInfo.UseShellExecute = false;
        p.StartInfo.CreateNoWindow = true;
        p.StartInfo.RedirectStandardInput = true;
        p.StartInfo.RedirectStandardOutput = tru

推荐答案

Process.Start("IExplore.exe", "www.northwindtraders.com");


ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
startInfo.Arguments = "www.northwindtraders.com";
Process.Start(startInfo);


System.Diagnostics.Process.Start("Path","Arguments");



这篇关于如何通过C#打开cmd并执行.exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 14:16
查看更多