I have this step in sql server job
AAA.bat
content is this
call BBB.bat
call CCC.bat
BBB.bat
and CCC.bat
each run ETL packages.
When I run above step it throws error
BBB.bat is not recognized as an internal or external command, operable program or batch file... CCC.bat is not recognized as an internal or external command, operable program or batch file
However, when I replace AAA.bat
with either BBB.bat
or CCC.bat
it works as intended.
Are BBB.bat
and CCC.bat
in the same directory as AAA.bat
? You need to set the working directory first. In AAA.bat
add the following at the top of the file:
cd /d D:\Path\Client1
Or, call BBB.bat
and CCC.bat
using their full path.
A possibly better solution, depending on your environment and needs, would be to have your job contain two steps, each one calling the appropriate batch file (BBB
or CCC
) separately. That way, if you have a failure, its very obvious which batch file had a problem.