-1

I have a command that I would like to create a service from. For example: "java -jar agent.jar" (the command is blocking - when closing the cmd it will stop the agent). I would like to make the command run as a service in the background so I can log out from my user and it will still work. On Linux, I know for a fact that I can use nohup mycommand. The problem is on Windows OS. Also, replace java with javaw will solve the blocking issue but when I sign out it will still kill the agent. How do I do that? I'll appreciate your help!

Tomer.

  • In certain cases - such as for per-user background tasks - you can set up a new task under Computer Management / Task Scheduler which may avoids adding as a Windows Service. – DuncG Jan 11 '22 at 15:56

1 Answers1

1

Use Windows services feature.

Read this answer. And this solution.

Dudi Boy
  • 4,551
  • 1
  • 15
  • 30