问题描述
我在 Windows 7 上将 jenkins 作为服务运行.
I'm running jenkins on windows 7 as a service.
我想运行一个非常简单的工作来启动我的 Firefox.(例如)
I'd like to run a very simple job which will start my firefox. (for example)
我配置了一个自由风格的项目,并设置了执行 windows 批处理命令"选项.
I configured a free style project and set up the "Execute windows batch command" option.
在这里我尝试插入几个命令,但都失败了.
Here i have tried to insert couple of command which they all failed.
诸如echo hello"之类的命令或其他本机命令按预期工作.
Commands like "echo hello" or other native command working as expected.
但是像explorer"这样的命令——应该打开提到的目录,或者c:firefox.lnk"(应该打开firefox)不起作用.jenkins 似乎正在运行,但之后作业失败并出现错误.
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".(参见 http://antagonisticpleiotropy.blogspot.nl/2012/08/running-jenkins-in-windows-with-regular.html)
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)
另外:Windows 7 不允许服务进程创建 UI.请参阅其他 stackoverflow 问题:服务启动进程不会显示 GUI C#
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#
这篇关于在詹金斯中运行批处理命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!