【发布时间】:2018-08-09 13:48:44
【问题描述】:
如何在批处理脚本中并行执行一些任务并等待它们?
command1;
# command3, command4 and command5 should execute in sequence say task1
# command6, command7 and command8 should execute in sequence say task2
# both task1 and task2 should run independently
command3; command4; command5 | command6; command7; command8;
# should execute only after the above parallel tasks are completed
command9;
作为概念证明,我尝试了类似的方法,但它不起作用:
echo "Starting"
start /wait wait20.bat
start /wait wait40.bat
echo "Finishing"
wait20.bat 看起来像:
echo "starting 20 seconds job"
timeout 20
echo "finishing 20 seconds job"
我做错了什么?
【问题讨论】:
标签: windows batch-file cmd parallel-processing