I have a simple question. I want to run a bat file that should run post build. The bat file takes in to parameters previousVersion and currentVersion (These parameters are entered as Validating String Parameters before the build starts).
This is what I have tried Execute Windows Batch Command
set v = %currentVersion%
set pv = %previousVersion%
cmd \k "C:\jenkins\workspace\mybatfile.bat %pv% %p%"
The error I get is that cmd is not recognized as an internal or external command operable program or batch file exit 9009
Add the batch command as run. Click on Apply and save the configuration then, you will redirect to the Project Workspace. Click on the Build Now, it will execute the given batch command that executes the run. bat file. You can see the console results on the Console Output.
Replace "cmd \k" with "call"
The Execute Windows Batch command is running inside a cmd already; no need to specifically start a new one. Just "call" your BAT file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With