1

I have a job in Jenkins, which call some bat file. The bat file starts jar file with parameters. But from log I can see that the bat file started my server, but then it immediately closed it, but I want it to stay running.

the command which I am using is:

SCHTASKS /Create /RU SYSTEM /SC ONSTART /TN MYTASK /TR %PATHTOBATCH%
berry_burr
  • 241
  • 4
  • 19
  • Please paste the log. Looks like you meant to say machine but still wanted to clarify that by mentioning _server_, do you mean some machine or an application on that machine? – Technext Sep 19 '14 at 14:00
  • the bat file is used because I want to start jar file with parameters. – berry_burr Sep 19 '14 at 14:15
  • Take a look on my answer on [How to call a batch file in the parent folder of current batch file?](http://stackoverflow.com/a/24725044/3074564) with a description of the 4 methods which exist to call/start a batch file respectively application. And if you run something as scheduled task with system account, your batch file should contain full paths and names to everything and do not depend on **PATH** and **PATHEXT** as most likely different for system account in comparison to your user account. – Mofi Sep 19 '14 at 16:43
  • ok, I found the problem, it was in a script, because it cannot find a file it fails, otherwise SCHTASKS is working OK, my fault. – berry_burr Sep 23 '14 at 07:33

0 Answers0