Tag Archives: Nick Rozanski

Run any application as a service (using SrvStart)

Every so often I have come across circumastances where I have had to run a windows application as a service.  Some of these applications can be run quite happily and have been designed so, and using SC CREATE from the command prompt is usually adequate.

What if that doesn’t work?  Well, I have found a useful little dibber called SrvStart that enables you to run any application as a service, and here follows short concise guide how to (i’ll also assume you have some tech knowledge on how services work) !

Basically there are three steps after downloading SrvStart from the authors (Nick Rozanski) website, and I will take you through just enough to get you started!

First, copy the contents of the zip file to anywhere in your windows machines Path (for example c:\windows).

Secondly, create an ini file for SvcStart to read, this tells SvcStart what application you wish to run, an example can be found below, again copy this into you Path area.

svrstart

Finally, the third step, run a service as you would normally with SC CREATE from an administrator CMD prompt:

SC CREATE MonitorCTRLSVC DisplayName= “MonitorCTRLSVC” binPath= “srvstart.exe MonitorCTLSVC -c c:\windows\MonitorCTRLSVC.ini” start= auto

If successful, this should have created your windows service!

You can the check functionality via task managers services tab, and if you need to make any further configuration changes use the services console from there

To get this particular application to run as a service I had to create a service account so it could interact with the desktop (it’s a monitor control piece of software by a company called Tecton).

There you have it, three easy steps to get anything running as a service!

UPDATE:

As a member of my team spent some time following a documented set of instructions there is something worth noting….

Whilst 99.99% of windows applications are not case sensitive, it would appear svrstart.exe is.  Please take particular care with the .ini file.  The “startup”, “shutdown” variables are case sensitive and should be written as such in your .ini file 🙂

During this fault finding I found you can also use svrstart to install the service, so the cmd line becomes a little simpler, from the above it would become:

srvstart install MonitorCTRLSVC –c “c:\windows\MonitorCTRLSVC.ini”

Either way the result is exactly the same 🙂

Share This: