Solved Execute multiple batches in sequence

June 14, 2018 at 20:54:43
Specs: Windows 10
Hi,

I need to execute multiple batch files in sequence and next batch file only on success of previous batch execution (result code = 0)

Please help me with this.

Regards,
Eshwar.


See More: Execute multiple batches in sequence

Reply ↓  Report •

#1
June 15, 2018 at 05:19:09
✔ Best Answer
make a batch file & call the other other ones( call batch2.bat ), then check for !errorlevel!
or make subroutines( call :batch1 ) & call them using exit /b & then check errorlevel

example:

@echo off&setlocal enabledelayedexpansion
call batch1.bat
if not "!errorlevel!"=="0" exit
call batch2.bat
if not "!errorlevel!"=="0" exit

etc.


if yoiu can give more info about what files in what folder & examples of the batch files I could make the script for you in the next few days

i5-6600K[delid]@4.8GHz/4.4GHz@1.39v LLC=6 | 2x4GB Crucial-DDR4-2133CL15@14-14-14-30 1T 2800MHz@1.37v
MSI Armor RX 570 4GB@1430Mhz core@1.256v/1900MHz BiosModded


Reply ↓  Report •

#2
June 15, 2018 at 05:23:48
if you want an example of using call :batchlabel
check the best answer to this thread:
https://www.computing.net/answers/p...

i5-6600K[delid]@4.8GHz/4.4GHz@1.39v LLC=6 | 2x4GB Crucial-DDR4-2133CL15@14-14-14-30 1T 2800MHz@1.37v
MSI Armor RX 570 4GB@1430Mhz core@1.256v/1900MHz BiosModded


Reply ↓  Report •
Related Solutions


Ask Question