Skip to content

How to Install Windows Service via Command Line

Category
Windows
Versions & support
About Windows →
On this page

The .net framework provides and command-line installer utility for installing services on the Windows system. You can use installutil.exe to install the Windows service via the command line. For .net 4 framework it’s available under C:\Windows\Microsoft.NET\Framework\v4.0.30319 directory.

How to Install Windows Service

First of all, navigate to the .net framework directory and then run installutil.exe followed by the Windows server exe file path.

cd "C:\Windows\Microsoft.NET\Framework\v4.0.30319\" 
installutil.exe 
 C:\Users\Rahul\WindowsService\bin\Debug\WindowsService.exe" 

This will install service on your system. In case it prompts for the authentication, Input the username, and password of your Windows system. Remember the user name must start with “.\” followed by username as shown in the below screen.

See the onscreen messages and check if the command successfully completed.

How to Uninstall Windows Service

To Uninstall the Windows service using “-u” option with the same command as installation. The command to uninstall the service looks like the below:

cd "C:\Windows\Microsoft.NET\Framework\v4.0.30319\" 
installutil.exe -u "C:\Users\Rahul\WindowsService\bin\Debug\WindowsService.exe" 

Conclusion

This tutorial helped you to install the service on the Windows system using the command prompt. Also provides you instructions to delete existing services. Next, you may like to read about managing Windows service via command line.

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top