mp.StartInfo.FileName = "E:\\Naag\\execute.bat";
mp.StartInfo.UseShellExecute = false;
mp.StartInfo.CreateNoWindow = true;
mp.StartInfo.RedirectStandardInput = true;
mp.StartInfo.RedirectStandardOutput = true;
for (i = StartSerialNo; i<EndSerialNo;i++)
{
iCnt++;
mp.StartInfo.Arguments = sFileName+StartSerialNo.ToString()+ " " + smyName;
mp.Start();
mp.WaitForExit();
}
execute.bat의 인수는 filename4567입니다. myname입니다. 이제 Execute.bat는 4 개의 .out 파일을 생성합니다.C에서 몇 dos 명령을 반복하는 방법 #
나는 루프를 만들고 싶으므로 10 번에 40 개의 .out 파일을 가져야한다. 하지만 4 개의 .out 파일 만 있습니다.
이는 루프가 한 번만 수행되었음을 나타냅니다. 그래서 무엇이 잘못 되었습니까?
C#에서 dos 명령을 루프하는 방법은 무엇입니까?
아마도 execute.bat가 이러한 4 개의 파일을 반복적으로 덮어 쓰는 것일까 요? – Henrik
** StartSerialNo **는 동일합니다. 아마도 ** i **를 사용하고 싶습니까? – fankt
그리고 도스는 어디에서 사진으로 나오나요? – CodesInChaos