KBEC-00106 - Calling a batch script in a step

Article ID:360032831452
1 minute readKnowledge base

Description

A step command that executes a batch script does not run any commands after that script. This is because CloudBees CD (CloudBees Flow) steps run in a batch file under cmd by default.

Solution

Use the 'call' function to allow the specified batch script to execute and then continue with the remaining commands.

Examples

If you have a step command sequence as follows, the 'dir' command will not execute:

set myStatus=true
setup.bat
dir

To allow the command sequence to continue after the batch script, call the script instead:

set myStatus=true
call setup.bat
dir