ServiceEx is a freeware Windows application that allows a normal program to run as a Windows service. Currently it is command line only. A version with a GUI is forthcoming. In the meantime, configuration options are specified via an .ini file that must be created prior to running ServiceEx.

ServiceEx differs from Microsoft's srvany in that it monitors the program and relaunches it whenever it shuts down for any reason. If you do not wish to have this behavior, you can turn it off. A link to download it is provided below.

An example .ini file can be downloaded below. The values which can be specified are shown in the following table:

Ini File VariableDescriptionPossible Value(s)
ServiceExeFullPathAny valid executable pathFull path to program you want to run as a service.
optionsAny valid command line argumentsOptions required by the program (can be blank)
desktopWhether to show the program's interface.true or false
StartHow the service should start up (at boot, manually, or neither)Auto or Manual or Disabled
StartNowWhether ServiceEx should start the service immediately*.true or false
Note: once installed, the service should be started and stopped using the Services manager, not by running ServiceEx.

To get started with ServiceEx:

  1. Download the executable file here. No installation program is needed. Just copy the executable to any directory that you wish to keep it.
  2. Download the example .ini file here. Save it in the same directory where you saved the file ServiceEx.exe

Note: ServiceEx is free to use. It is provided with no warranties of any kind. Use at your own risk.

Thanks is due to Iain Patterson whose NSSM Service Manager provided a starting point for this software.

Questions or comments

How to Configure ServiceEx Client Restarts

By default, ServiceEx will restart the underlying application whenever it shuts down. If you do not want this behavior, you can disable it. For now, this requires modifying the registry. This is an advanced action which you should only do if you know what you are doing. Here is how you do it:
  1. Open up regedit (if you don't know how to do that, you should stop now).
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<your service name>\Parameters
  3. In the parameters list (where you see AppParameters, etc.), add a new DWORD value called "Restart", without the quotes.
  4. Make the value one of the following:
    • 0 - if you do not want ServiceEx to ever restart the application.
    • 1 - if you want ServiceEx to restart the application only when it exits with a nonzero return value.
    • 2 - if you want ServiceEx to always restart the application. This is the default behavior, so if you want it to do this, you don't need to enter this value at all.

Other Links