0
下面是從命令提示符處運行批處理文件的代碼。問題是在批處理文件中存在暫停應用程序的暫停命令,我無法繼續下一步。有人能給我一個解決這個問題的想法嗎?如何擺脫從命令提示符使用c打開的批處理文件中的暫停命令
Process gacCOMprocess = new Process();
infoPageExecuteBatchFiles.PageText = "Running gacCOM.bat ";
infoPageExecuteBatchFiles.Refresh();
ProcessStartInfo gacCOMprocessStartInfo = new ProcessStartInfo();
gacCOMprocessStartInfo.FileName = PRES_TIER_PATH + "\\gacCOM.bat ";
gacCOMprocessStartInfo.UseShellExecute = false;
gacCOMprocessStartInfo.RedirectStandardOutput = true;
gacCOMprocessStartInfo.CreateNoWindow = true;
gacCOMprocessStartInfo.RedirectStandardInput = true;
gacCOMprocess.StartInfo = gacCOMprocessStartInfo;
gacCOMprocess.OutputDataReceived += new DataReceivedEventHandler(ExecuteBatchFilesHandler);
gacCOMprocess.Start();
gacCOMprocess.BeginOutputReadLine();
gacCOMprocess.WaitForExit();
gacCOMprocess.Close();
通過重定向的StandardInput發送CRLF可能會有幫助。 – Heinzi
不能從文件中手動刪除暫停:gacCOM.bat?或者在另一個文件中克隆該文件,請刪除暫停並運行克隆。 –
可以簡單地expal –