Forum posts for srvany.exe

Creating Service from Executable (INSTSRV.EXE and SRVANY.EXE) Error - 'Service started and t…

I am trying to create a service on Windows using my own executable. When I try to start the service, I get the error message:


'The service on Local Computer started and then
stopped. Some services stop automatically if they have no work to
do...'


The exe should always be doing work because it is constantly running a timer that checks the time and makes database backups at certain points during the day. I have tested the executable on its own (not as a service) and it works fine.

I created the service using a batch file and INSTSRV.EXE and SRVANY.EXE. The batch file looks like this:

start /d 'C:<exe directory>' INSTSRV.EXE <service name> 'C:<exe
directory>SRVANY.EXE'


The server name now shows up in my list of services on my computer. I also edited the registry to make sure everything was in order. Here is what my regedit entry looks like:

Service key

DisplayName REG_SZ <service name>
ErrorControl REG_DWORD 0
ImagePath REG_EXPAND_SZ 'C:<exe directory>SRVANY.EXE' <service name> C:<exe directory>SRVANY.EXE
ObjectName REG_SZ LocalSystem
Start REG_DWORD 2
Type REG_DWORD 16

Parameters key

AppDirectory REG_SZ E:<exe directory>
Application REG_SZ E:<exe directory><exe file name>


I have used a similar batch file before to make a service from an executable, and I have compared the registry entries of that service with my own service's registry entries. They are pretty identical. I don't know why my service doesn't want to start.
Any help or suggestions would be greatly appreciated!

View complete forum thread with replies

Other posts related to srvany.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Windows srvany.exe and service STOP
Problems running python program with srvany.exe
srvany.exe does not start .bat file
Creating Service from Executable (INSTSRV.EXE and SRVANY.EXE) Error - 'Service started and t&hellip;
Specify command line for application while creating service using SRVANY.EXE
Searching for srvany.exe from Windows 7 Resource Kit: is this actual software or just a book?
Installing srvany.exe to run a jar file as a service using InstallShield (without editing th&hellip;

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.