windows 在詹金斯中运行批处理命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17504811/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Run batch command in jenkins
提问by ork
I'm running jenkins on windows 7 as a service.
我在 Windows 7 上运行 jenkins 作为服务。
I'd like to run a very simple job which will start my firefox. (for example)
我想运行一个非常简单的工作来启动我的 Firefox。(例如)
I configured a free style project and set up the "Execute windows batch command" option.
我配置了一个自由风格的项目并设置了“执行 Windows 批处理命令”选项。
Here i have tried to insert couple of command which they all failed.
在这里,我试图插入几个命令,但它们都失败了。
Commands like "echo hello" or other native command working as expected.
像“echo hello”这样的命令或其他按预期工作的本机命令。
But command like "explorer " - should open the mentioned directory, or "c:\firefox.lnk" (should open firefox) are not working. The jenkins seems to be running but after while the job fails with an error.
但是像“explorer”这样的命令 - 应该打开提到的目录,或者“c:\firefox.lnk”(应该打开firefox)不起作用。jenkins 似乎正在运行,但之后作业失败并出现错误。
How can i run these actions?
我如何运行这些操作?
Thanks.
谢谢。
采纳答案by Simon Groenewolt
This might be a path issue, check if the System user has 'explorer' in its path. (see http://antagonisticpleiotropy.blogspot.nl/2012/08/running-jenkins-in-windows-with-regular.html)
这可能是路径问题,请检查系统用户的路径中是否有“资源管理器”。(见http://antagonisticpleiotropy.blogspot.nl/2012/08/running-jenkins-in-windows-with-regular.html)
Additionally: Windows 7 does not allow service processes to create a UI. See this other stackoverflow question: Service starting a process wont show GUI C#
另外:Windows 7 不允许服务进程创建 UI。请参阅其他 stackoverflow 问题:服务启动进程不会显示 GUI C#