Any way to override .NET Windows Service Name without recompiling?

Nathan picture Nathan · Nov 10, 2009 · Viewed 55.8k times · Source

I have a windows service executable that I know is written in .NET which I need to install under a different service name to avoid a conflict. The install doesn't provide anyway to specify a service name. If I only have access to the binary, is there anyway to override the service name when I install it with installutil?

Answer

Josh Yeager picture Josh Yeager · Nov 10, 2009

Do you have to use InstallUtil? Here are the commands to do what you want using sc:

sc create MyService binPath= "MyService.exe" DisplayName= "MyService"  
sc description MyService "My description"

Reference: http://support.microsoft.com/kb/251192