批处理文件停止第一个命令运行后, [英] Batch file stops running after the first command

查看:192
本文介绍了批处理文件停止第一个命令运行后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的工具HTML匹配来比较两个HTML文件。因为我有比较多​​的文件,我创建了像followion的批处理文件。比如,我给的文件只有五集。

I am using the tool 'HTML Match' to compare two HTML files. As I have to compare many files, I create a batch file like the followion. For example, I give only five sets of files.

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,被比较,并产生一个结果。然后执行停止。

When I execute this batch file in a cmd prompt, only the first line, that is, only 'a1.html', gets compared and produces a result. Then execution stops.

推荐答案

添加呼叫在你正在运行的命令的前面。

Add call in front of the commands you're running.

您也可以将其更改为一个for循环,所以:

You can also change this to a for loop, so:

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

这篇关于批处理文件停止第一个命令运行后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆