Install and Uninstall Windows Service using InstallUtil.exe

In this article, you can learn how to Install and Uninstall Windows Service using InstallUtil.exe utility. InstallUtil.exe is the command-line utility which is available in .NET framework installation folder.


Install and Uninstall Windows Service using InstallUtil.exe:

The windows service applications which are created using .NET Framework, uses the command line utility InstallUtil.exe to install and uninstall the services. This tool is usually available in under Microsoft .NET framework installation path. The version number can be vary.

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe

Install Windows services using command line:

To install .NET service, you need to run the below command by using command-prompt by specifying the full path of the .NET service application.


InstallUtil “D:\MyApp\MyService.exe”

UnInstall Windows services using command line:

To Uninstall .NET service you need to run the below command by using command-prompt by specifying the full path of the .NET service application.


InstallUtil /u “D:\MyApp\MyService.exe”

You can also run InstallUtil.exe directly by using the Visual Studio Developer Command Prompt. In this case, InstallUtil.exe should be on the system path. Otherwise, you can add it to the path, or use the fully qualified path to invoke it. This tool is installed with the .NET Framework in %WINDIR%\Microsoft.NET\Framework[64]\.

For the 32-bit version of the .NET Framework 4 or 4.5 and later, the default path is C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe.
Also, for the 64-bit version of the .NET Framework 4 or 4.5 and later, the default path is C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe.

Note: The v4.0.30319 is the framework version.


– Article ends here –

Recommended:   How to list all the dependent windows services using C#
Share this:

Kiran is a Software engineer by profession and Enthusiastic blogger, love to write articles on computer technology and programming. Reach him at kiran.troubleshootyourself@gmail.com.

We will be happy to hear your thoughts

Leave a reply

Troubleshootyourself
Logo
Shopping cart