4

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.

tim_yates
  • 167,322
  • 27
  • 342
  • 338
ork
  • 209
  • 3
  • 9
  • 17
  • Please post the error that they fail with. – Piccolo Jul 06 '13 at 16:29
  • I don't have any error. Jenkins keep running until i manually stop the job. This is the output i see : " Started by user anonymous Building in workspace C:\Program Files (x86)\Jenkins\jobs\Selenium2\workspace [workspace] $ cmd /c call C:\Users\Or\AppData\Local\Temp\hudson3311426922560007225.bat C:\Program Files (x86)\Jenkins\jobs\Selenium2\workspace>explorer . Build was aborted Finished: ABORTED " – ork Jul 06 '13 at 16:31
  • In your case, the jenkin process run as service. The newly launched process explorer/firefox etc may be available on system console. I install and run VNC as a service to access the system console – Jayan Jul 06 '13 at 16:48
  • And with the VNC could i connect the jenkins service ? – ork Jul 06 '13 at 21:29
  • http://stackoverflow.com/questions/16782414/how-to-run-testng-tests-on-jenkins/31716581#31716581 – Shubham Jain Sep 14 '15 at 14:08

1 Answers1

3

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#

Community
  • 1
  • 1
Simon Groenewolt
  • 10,607
  • 1
  • 36
  • 64
  • Great, that was the reason. Do you know how can i run jenkins not as a service? there is any .bat file that i can run jenkins? thanks. – ork Jul 06 '13 at 21:26
  • OK, i run it with tomcat and the war file, and It's all working! thanks so much! – ork Jul 06 '13 at 21:38