Install and Uninstall Windows Service using InstallUtil.exe

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


Install and Uninstall Windows Service using InstallUtil.exe:

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

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

How to Install Windows services using command line?

To install the .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”

How to UnInstall Windows services using command line?

To Uninstall the .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 –

If you have any questions, please feel free to share your questions or comments on the comment box below.

Recommended:   How to list all the dependent windows services using C#
Share this:
We will be happy to hear your thoughts

Leave a reply

Troubleshootyourself
Logo