Stage fails when batch script return one exit 1

Hello, I am new to Jenkins. I have a batch script which return exit code as 1. I am executing this batch through same pipeline script on 2 different windows machines.

For one machine pipeline executing successfully and for another pipeline stage is failing due to batch returning error code as 1.

Why the pipeline behaviour is different for the same script ?

I had searched for the solution but didn’t get it.

Thank you !

Often it is because there is an important difference in the execution environment of one of the batch scripts compared to the other. That important difference is enough to cause the script to fail on one agent and succeed on another agent.

Run the command interactively in each of the environments. Report the return code. If the return codes are different, explore to understand why they are different.