Any Application as a Service

To install any application as service download and install Windows Server 2003 Resource Kit. (It does not need to be installed on target machine.)

Copy files srvany.exe and instsrv.exe from Resource Kit install directory to target machine.

To create new service on target machine run in command line (on Windows 7 or 2008 Server as Administrator):

instsrv <<Service Name>> <<Path to srvany.exe>> e.g,: instsrv MyCustomService “c:\Program Files\SrvAny\srvany.exe”

Open Computer Management and find your service.

In Properties → Log On →

  • This Account → Local administrator  – If administrator / user account is needed (target application needs to be configured under user account)
  • System Account – If there’s no need for further application configuration.

Open registry and follow keys:

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\<<ServiceName>>\Parameters]

Add following keys:

  • AppDirectory” – Value: “<<Full path to target applications directory>>”
  • Application” – Value: “<<Full path to target aplication>>”

e.g.

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\TEST\Parameters]

  • “AppDirectory”=”C:\\Program Files\\TEST”
  • “Application”=”C:\\Program Files\\TEST\\test.exe”

Now configure target application and run the service.