简体   繁体   English

在jenkins中运行批处理命令

[英]Run batch command in jenkins

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. 我想运行一个非常简单的工作,它将启动我的Firefox。 (for example) (例如)

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. 但是像“explorer”这样的命令 - 应该打开提到的目录,或者“c:\\ firefox.lnk”(应该打开firefox)不起作用。 The jenkins seems to be running but after while the job fails with an error. jenkins似乎正在运行,但是在作业失败并出现错误之后。

How can i run these actions? 我该如何运行这些操作?

Thanks. 谢谢。

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. 此外:Windows 7不允许服务进程创建UI。 See this other stackoverflow question: Service starting a process wont show GUI C# 请参阅此其他stackoverflow问题: 启动进程的服务不会显示GUI C#

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM