Windows – srvstart.exe based service start and then shutdown. [win7-64]

servicewindows

I tried to create a service to launch an app as a service with srvstart.exe using this syntax

SC CREATE myapp DisplayName= "myapp" binPath= “srvstart.exe myapp -c E:\Systema\myapp\myapp.ini” start= auto

where myapp.ini is

[myapp]
startup=”E:\Systema\myapp\myapp.exe”
shutdown_method=winmessage

but whenever I try to start the service I get this message

THE myapp SERVICE ON LOCAL COMPUTER STARTED AND THEN STOPPED.SOME
SERVICES STOP AUTOMATICALLY IF THEY ARE NOT IN USE BY OTHER SERVICES
OR PROGRAMS

Have I done something wrong?
Is there any other way to create a simple background service of an exe?

Best Answer

Oh, I just found http://nssm.cc/ and it works seamlessly and it's only:

nssm install myapp

and a nice gui do the rest of the work.

PD: I suspect than srvstart is just for winxp and SC do the work itself (the hard way)