If you’re developing a Windows Service by using the .NET Framework, you can quickly install your service application by using a command-line utility called InstallUtil.exe.

I usually use two bat files the first one for installation and the second for uninstallation of service

Install Service
Open Notepad.exe and paste this code, you change path with your Application Service

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
c:
installutil "C:\Program Files (x86)\IS\In4MaticCard\IsIn4MaticCard.exe"
pause

exit

Save file as InstallService.bat

Right click on file InstallService.bat and select Run with Administrator, the service will be installed

Uninstall Service


cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
c:
installutil /u "C:\Program Files (x86)\IS\In4MaticCard\IsIn4MaticCard.exe"
pause

exit

Save file as UnInstallService.bat

Right click on file UnInstallService.bat and select Run with Administrator, the service will be uninstalled

If your Application Service is 64 bit, change path of installutil application:

from 32 bit:

C:\Windows\Microsoft.NET\Framework\v4.0.30319

to 64 bit:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

see also:
AutoRestart Windows Service
Install Service without using installutil

Advertisements