Maybe this is obvious to everyone here, but it just cost me 45 minutes so I thought I'd share a tip just in case it is useful to anybody else.
I'm running on a Windows build agent and was trying to run an echo command but it kept failing with the following (anonymized output):
ERROR - Step 'master>Build Pipeline>xxxx build step' is failed. com.pmease.quickbuild.QuickbuildException: Cannot run program "echo" (in directory "C:\xxx\xxx\xxx"): CreateProcess error=2, The system cannot find the file specified
The trick in the end was to replace this:
echo "foobar"
with this:
cmd /c echo "foobar"
As with all problems, the answer is obvious when you know it!
Hope it helps,
Mark