【发布时间】:2023-04-08 06:24:01
【问题描述】:
我有两个批处理文件,
第一个,包含多个命令,每个命令有两个参数,它调用batch2 例如
C:\batch2 test1 "Hello this is a test"
C:\batch2 test2 "Hello this is a test as well"
第二个,包含.exe调用,并从batch1中获取参数
C:\test.exe %1 %2
.exe 做的东西,它的结尾如下:
Console.WriteLine("complete", dir, output);
output.Close();
Console.Read();
问题是,batch1 的第一行运行后,第二行永远不会运行。我可以在 .exe(C# 程序)的末尾添加什么来保持 batch1 为每个后续行运行?
或者,我怎样才能让 batch1 在第一行之后继续运行?
【问题讨论】:
-
您可能想研究线程和多线程。这使您可以启动两个长进程,而不必等待它们完成后再开始下一个 exe。
标签: c# batch-file batch-processing