Thursday, August 8, 2013

How to install or uninstall Windows Service from CMD command line?

In command line, go to .Net Framework folder:
C:\Windows\Microsoft.NET\Framework\v4.0.30319

Run following line:
installutil C:\folder name\ServiceHost.exe

Uninstall:
installutil /u C:\folder name\ServiceHost.exe


If want to install service with different display name:
sc create "Your Service Name" binpath= "fullpath of your exe file"

No comments:

Post a Comment