Can a windows service (possibly copied to multiple locations) be ran multiple times using different configurations (say for instance if the service supports commandline arguments)?

A service seems to be only installed once since the name has to be unique.

Is this scenario possible and what is the best way to do this?

2 Answers 2


That is the basis for "svchost.exe", it is just given different service names and parameters.

This will help: http://support.microsoft.com/kb/137890

  • Interesting. A question though: the KB gives as an example that it makes a service from 'notepad' which inherently is not a service but just a plain exe. Does this trick also work for real services?
    – reinier
    Commented Sep 3, 2010 at 13:20
  • AFAIK its meant to illustrate that ANY program can be run as a service.. although I would use some form of daemon myself.
    – Grizly
    Commented Sep 8, 2010 at 10:59
  • Or to say it differently, starting multiple instances of a service is perfectly possible. It just depends on you setting it up, and the application actually supporting it. One semi-common example is MSDE. MSDE allows you to install several instances each as a separate service.
    – Zoredache
    Commented Sep 22, 2010 at 7:03
  • Notepad doesn't actually work as a service anyway; it fails to tell the SCM that it is up and running in a timely fashion...
    – SamB
    Commented Nov 28, 2010 at 18:17

If by multiple instances of the same service, you mean different instances of the same executable, then sure. You just need to create multiple "service" entries for it in the service table, with different names and different command line options.

Grizly seems to be talking about a different thing, where several services run inside the same process, typically an instance of svchost.exe. This necessitates that they use the same executable, though each service hosted by svchost appears to specify a DLL and (optionally) a ServiceMain entrypoint in the Parameters subkey of the service key. (Of course, the details of svchost.exe usage don't appear to be documented -- probably to keep people from trying to do crazy stuff like loading some version of the .NET framework into one of the system-critical instances, which would eventually lead to some other service trying to load a different version of the framework into the same one, and that would be a complete mess...)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .