开发者

How to run Windows command in chain

I found the bat file from here:

http://www.dostips.com/DtCodeBatchFile开发者_StackOverflow中文版s.php#Batch.FindAndReplace

I want to run another command after this bat, but it doesn't work. I guess there must be something wrong the the code the site provides. Anyone can give me a clue?


You can chain commands in dos using the && for example

echo hello&&echo world


As per Microsoft Support:

This behavior occurs because the && command separator performs error checking. If the command to the left of the && command does not return the expected results, the commands to the right of the && command do not run.

And

When you use a single & command, error checking is not performed and all commands run.

You can check here:

Using multiple commands and conditional processing symbols

Multiple Commands on a Single Line May Not Run When You Use the && Command Separator (archived page)

Original link - No longer exists

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜