Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to stop the execution of group of batch files when an if condition failed  (Read 2517 times)

0 Members and 1 Guest are viewing this topic.

simhadri1985

    Topic Starter


    Rookie

    I have a 6 batch files(sample1.bat, sample2.bat, sample3.bat, sample4.bat, sample5.bat, sample6.bat) which will be executed one after the other. I have an if condition in the 3rd batch file(sample3.bat).

     If this IF condition failed I want to block the execution of remaining batch files (sample4.bat, sample5.bat, sample6.bat)

    Please help.. Thanks in advance

    Helpmeh



      Guru

    • Roar.
    • Thanked: 123
      • Yes
      • Yes
    • Computer: Specs
    • Experience: Familiar
    • OS: Windows 8
    Well. If the batch files are executing the next one then just do this:

    If something equ something (your commands) ELSE (exit)
    Where's MagicSpeed?
    Quote from: 'matt'
    He's playing a game called IRL. Great graphics, *censored* gameplay.

    Salmon Trout

    • Guest
    I have a 6 batch files(sample1.bat, sample2.bat, sample3.bat, sample4.bat, sample5.bat, sample6.bat) which will be executed one after the other. I have an if condition in the 3rd batch file(sample3.bat).

     If this IF condition failed I want to block the execution of remaining batch files (sample4.bat, sample5.bat, sample6.bat)

    Please help.. Thanks in advance

    Why are they all separate? Why cannot the code be in one file?