You can do it as follows:
start MyFile2.bat argA, argB, argC start MyFile2.bat argX, argY, argZ ^& echo.^>End.val ^& exit :testEnd if exist end.val (del end.val echo Process completed pause) >nul PING localhost -n 2 -w 1000 goto:testEnd
When the second start start2.bat start is the task, then the file "End.val" will be created, you just need to check if this file exists, then you know that your process is completed.
If the first myfile2 may take longer and then the second, you can do the same (with a different file name) with the first start myfile2.bat and make the test larger in :testend
start MyFile2.bat argA, argB, argC ^& echo.^>End1.val ^& exit start MyFile2.bat argX, argY, argZ ^& echo.^>End.val ^& exit :testEnd if exist end.val if exist end1.val (del end.val del end1.val echo Process completed pause) >nul PING localhost -n 2 -w 1000 goto:testEnd
Sachadeee
source share