这就是从C#运行shell命令所要做的全部
string strCmdText;strCmdText= "/C copy /b Image1.jpg + Archive.rar Image2.jpg";System.Diagnostics.Process.Start("CMD.exe",strCmdText);编辑:
这是为了隐藏cmd窗口。
System.Diagnostics.Process process = new System.Diagnostics.Process();System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;startInfo.FileName = "cmd.exe";startInfo.Arguments = "/C copy /b Image1.jpg + Archive.rar Image2.jpg";process.StartInfo = startInfo;process.Start();
编辑:2
重要的是,该论点始于
/C否则将不起作用。斯科特·弗格森(Scott
Ferguson)怎么说:“执行由字符串指定的命令,然后终止。”



