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
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.