Patrick Wrigley
asked on
How create a service from a single .exe file
I am trying to create a service out of a simple .exe file
using the following command:
sc.exe create messageAll binPath= "C:\MSG_Service\messageAll.exe"
the service is successfully created:
C:\Windows\system32>sc.exe create messageAll binPath= "C:\MSG_Service\messageAll.exe"
[SC] CreateService SUCCESS
But when I try to start the service I get the follwing error
using the following command:
sc.exe create messageAll binPath= "C:\MSG_Service\messageAll.exe"
the service is successfully created:
C:\Windows\system32>sc.exe create messageAll binPath= "C:\MSG_Service\messageAll.exe"
[SC] CreateService SUCCESS
But when I try to start the service I get the follwing error
ASKER
the only item in the folder C:\MSG_Service is the messageAll.exe
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The best approach to do that is to use http://nssm.cc/
Install your sevice with nssm.exe install [serviceName]
it is really good
Install your sevice with nssm.exe install [serviceName]
it is really good
@Arana, I slightly disagree. You don't win anything by running it as a service, Running it as scheduled task is sufficient in almost every case. Since the dawn of NT, I never had an use-case where this would be necessary.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i remember the days when we could tell the difference between forced accepts, actual accepts, community based accepts... sigh
Well you do gain something, using nssm you can actually monitor if service (application) is really running and it handles restart on crash, system logs etc. While yes starting a task can be enough for the app to start you have to handle the restarts, the logs, etc.
Imho it is the wrong approach.
It's like using a hammer and a screw to hang up a picture. It can be done, but it's simply not correct.
It's like using a hammer and a screw to hang up a picture. It can be done, but it's simply not correct.
i love the analogy !
monitor your services instead of using a watchdog per service.
btw, who is expected to monitor the watchdog ?
monitor your services instead of using a watchdog per service.
btw, who is expected to monitor the watchdog ?
ASKER