Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

windows - Run batch command in jenkins

I'm running jenkins on windows 7 as a service.

I'd like to run a very simple job which will start my firefox. (for example)

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.

Commands like "echo hello" or other native command working as expected.

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.

How can i run these actions?

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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)

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#


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...