I found the bat file from here:
http://www.dostips.com/DtCodeBatchFiles.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?
Try using the conditional execution & or the && between each command either with a copy and paste into the cmd.exe window or in a batch file. Additionally, you can use the double pipe || symbols instead to only run the next command if the previous command failed.
Instead of scheduling multiple Windows Tasks that may overlap, use the "start /wait" command a batch file (. bat) to automatically run multiple commands in sequential order.
Click Start, type cmd, and press Enter to open a command prompt window. In the Windows taskbar, right-click the command prompt window icon and select Command Prompt. A second command prompt window is opened.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With