Hello All,
Greetings for the day.
This is about windows batch files, my batch file will call couple of batch files internally, we have 2 conditions like error and success conditions, if nay batch files get fails, that should be go to error condition if all batch are doing well it will go to success conditions, but we got new requirement that is if few batch files fails it should not go to the error condition, those batch files will just go to exit to another condition(3rd condition ) could you please tell us how to use the condition to go to 3rd condition
we have used below code please find that
internally batch file code
@Call :DispMsg "*========== %bProcNm% Successful Exit ==========" %DATE% %TIME%
@dir \ > Nul 2>&1
@goto ExitBat
:Errexit
@Call :DispMsg "*=*=*=*=*=*=* %bProcNm% ERROR EXIT !!! =*=*=*=*=*=*"
@goto ExitBat
:ExitBat
@if not .%1 == .nopause pause
@goto :EOF
main batch file code
@Call :DispMsg "*========== %bProcNm% Successful Exit ==========" %DATE% %TIME%
@dir \ > Nul 2>&1
@goto ExitBat
:Errexit
@Call :DispMsg "*=*=*=*=*=*=* %bProcNm% ERROR EXIT !!! =*=*=*=*=*=*"
@xcopy xxxFFFxxxFFF > nul 2>&1
@goto ExitBat
:ExitBat
@if not .%1 == .nopause pause
@goto :EOF
In above internal code will go to either error or success always and main program will follow the same accordingly.
but here when the internal batch file code get error it should not use the error condition in the main batch file instead of this it should use new condition(3rd condition)----- this is my requirement
could you please give your suggestions on this
Thanks
Nag