Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 782
Nathan Avatar asked Nov 09 '09 23:11

Nathan


2 Answers

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

like image 161
Josh Yeager Avatar answered Oct 02 '22 19:10

Josh Yeager


It is not true that InstallUtil doesn't allow you to configure the service name. I do it all the time like this

InstallUtil.exe /servicename="<service name>" "<path to service exe>" 
like image 30
Sachin Kainth Avatar answered Oct 02 '22 19:10

Sachin Kainth