Issue
Currently I'm writing a Jenkins pipeline, in which there are lots of batch scripts that ends with "Press any key to continue...". The problem is that when Jenkins run those scripts it counted that line as failure (return 1) and the build aborts. I tried to make the pipeline accept the return 1 as success but when the scripts failed to run it also returns 1 and Jenkins cannot tell the differences between the two.
I cannot remove that line because we still have to manually build the project sometimes. How can I modify either the Jenkin script or the batch script that accept that "press any key to continues..." line as success without changing how the batch script work when ran manually?
Thank you.
Solution
As @Mofi mentioned, you'll need to set the execution directory the same as the script directory using dir ("""${trunk}\""")
Answered By - Hiep Le Thanh
Answer Checked By - Cary Denson (JavaFixing Admin)