This article will help you to install or uninstall a Windows Service. The Windows Service is written or developed in .NET using C#. To install or uninstall Windows Service that was created using the .NET Framework we need to use InstallUtil.exe Utility.
Steps to install .Net Windows Service
Step 1
Open the command prompt as run as administrator
Step 2
To install windows service was created using .Net InstallUtil.exe utility for installation of windows services which found in below location use appropriate version as your service developed .Net Framework version.
Go to below path using run windows:
C:\Windows\Microsoft.NET\Framework\
Then select the appropriate version as your .Net Framework version like below
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe
Step 3
Type the below command on command prompt as per the below screenshoot
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\
Then type command Installutil.exe "Path of your Windows Service exe" as in the below snapshoot and then Press Enter which will install your windows services and you will get message like The Transacted install has completed as per below.
Steps to check install .Net Windows Service
Once the Windows service has been installed you will enable this service by typing Services.msc in run windows, and it will open all windows services. From there you can see your install service and you can start and stop your services.
Steps to uninstall .Net Windows Service
Follow the same steps as follow for install windows service except intsted of Installutil.exe using installutil.exe \u for uninstalling the windows services as per below
Installutil.exe /u "Path of your Windows Service exe"
Once you run this command in the command window and press enter then you will get the message The Uninstall has completed.
Summary
With this article I explained how to install and uninstall .Net windows services using installutil.exe.