在詹金斯中运行bat文件 [英] Running bat files in Jenkins
问题描述
我有一个简单的问题.我想运行一个应在构建后运行的bat文件. bat文件采用参数previousVersion和currentVersion(在构建开始之前,这些参数作为Validating String Parameters输入).
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).
这就是我尝试过的 执行Windows批处理命令
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%"
我得到的错误是cmd无法识别为内部或外部命令可操作程序或批处理文件出口9009
The error I get is that cmd is not recognized as an internal or external command operable program or batch file exit 9009
推荐答案
将"cmd \ k"替换为通话"
Replace "cmd \k" with "call"
执行Windows批处理"命令已在cmd内运行;无需专门启动新的.只需调用"您的BAT文件即可.
The Execute Windows Batch command is running inside a cmd already; no need to specifically start a new one. Just "call" your BAT file.
这篇关于在詹金斯中运行bat文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!