【发布时间】:2011-05-02 12:22:27
【问题描述】:
如何在 IIS 中启动 XXX.bat 文件?我想运行这个文件..当我在我的开发 PC 中执行它时它完美运行。但是当我在 IIS 中部署它时,它可以工作而不是执行 .bat 文件
所以请指导我如何做...我的代码如下
\\
string exefile = ConfigurationManager.AppSettings["exefile"]; //exefile="D:\\XX\\xxx.bat"
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(exefile);
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
psi.RedirectStandardOutput = true;
psi.RedirectStandardInput = true;
psi.RedirectStandardError = true;
System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);
\\
【问题讨论】: