批处理文件在第一个命令后停止运行

我使用工具“HTML Match”来比较两个HTML文件。因为我不得不比较许多文件,我创建一个批处理文件像下面。例如,我只给出五组文件。

cd "C:\Program Files\HTML Match"
HTMLMATCH.EXE "D:\Raj\compare1\a1.html" "D:\Raj\compare2\a1.html" "D:\Raj\compare_res\a1.html"
HTMLMATCH.EXE "D:\Raj\compare1\a2.html" "D:\Raj\compare2\a2.html" "D:\Raj\compare_res\a2.html"
HTMLMATCH.EXE "D:\Raj\compare1\a3.html" "D:\Raj\compare2\a3.html" "D:\Raj\compare_res\a3.html"
HTMLMATCH.EXE "D:\Raj\compare1\a4.html" "D:\Raj\compare2\a4.html" "D:\Raj\compare_res\a4.html"
HTMLMATCH.EXE "D:\Raj\compare1\a5.html" "D:\Raj\compare2\a5.html" "D:\Raj\compare_res\a5.html"

当我在cmd提示符中执行此批处理文件时,只有第一行,即只有“a1.html”被比较,并产生一个结果。然后执行停止。

在正在运行的命令前添加调用。

您还可以将其更改为for循环,因此:

FOR /L %i in (1,1,5) DO CALL HTMLMATCH.EXE D:\Raj\compare%i%\a%i%.html D:\Raj\compare%i%\a%i%.html D:\Raj\compare_res\a%i%.html
http://stackoverflow.com/questions/7320074/batch-file-stops-running-after-the-first-command

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:批处理文件在第一个命令后停止运行