0

I have a powershell script, which start a java application through a batch file.

the powershell doesn't exit because the java (processs) is still running,

I cant use taskkill because I need the java to keep running,

the process is automated with TeamCity so I can't just close the CMD window manually.

Any suggestions?

Shahar Hamuzim Rajuan
  • 5,610
  • 9
  • 53
  • 91
  • Why not make the session go invisible - see kludge here - http://stackoverflow.com/questions/20717535/determine-if-script-is-running-hidden – Knuckle-Dragger Feb 17 '14 at 00:23

3 Answers3

0

Why don't you just use Start-process CmdLet to start your java process ?

JPBlanc
  • 70,406
  • 17
  • 130
  • 175
  • i've tried and it opens the process on another CMD window, which never closes and i cant use the flag /wait=false because it closes the window before the Java is even starting – Shahar Hamuzim Rajuan Feb 15 '14 at 17:23
0

Instead of calling java from powershell directly, you could try:

cmd /c java.exe <your stuff>

Which should allow it to start the java process and end the powershell script.

Welsh
  • 5,138
  • 3
  • 29
  • 43
0

At the end i used the Winexe tool, which allows you to start cmd command from Linux to windows machine. and ran the batch with this tool.

Shahar Hamuzim Rajuan
  • 5,610
  • 9
  • 53
  • 91