我有一个master.bat文件,其中包含:
call file1.bat
call file2.bat
我希望file2.bat在file1.bat完成执行并生成输出之前不开始运行,但在我的情况下file2.bat运行而不等待file1.bat完成执行。
文件执行时间如下:
file1.bat= 70 sec
file3.bat= 20 sec
编辑1
两个批处理文件的内容是:
文件1.bat
@ECHO OFF
setlocal enabledelayedexpansion
SET "keystring1="
(
FOR /f "delims=" %%a IN (
Source.txt
) DO (
ECHO %%a|FIND "Appprocess.exe" >NUL
IF NOT ERRORLEVEL 1 SET keystring1=%%a
FOR %%b IN (App1 App2 App3 App4 App5 App6 ) DO (
ECHO %%a|FIND "%%b" >NUL
IF NOT ERRORLEVEL 1 IF DEFINED keystring1 CALL ECHO(%%keystring1%% %%b&SET "keystring1="
)))>result.txt
GOTO :EOF
文件2.bat
@echo off
setlocal enabledelayedexpansion
(for /f "tokens=1,2" %%a in (memory.txt) do (
for /f "tokens=5" %%c in ('find " %%a " ^< result.txt ') do echo %%c %%b
))> new.txt