My answer to How do I run a Java program as background windows service?
Answer by Vaibhav Kashyap:
You’re looking for is basically a daemon program. The Windows equivalent of a daemon is a Windows Service. A daemon is a long-running background process that answers requests for services.
But you need to convert this daemon process, using. You need procrun to turn that into a Windows service. Download it from the and unpack whatever you chose to download. In my case, this was version 1.0.10 of the Windows binaries and the essential part in the archive is
prunsrv.exe, the procrun service application which is responsible for installing and removing the service.
prunmgr.exeis also an extremly useful application that provides a GUI to set everything you can configure via batch scripts.