Home > Net >  Windows - running command as a service
Windows - running command as a service

Time:01-12

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.

CodePudding user response:

Use Windows services feature.

Read this answer. And this solution.

  •  Tags:  
  • Related