Installing Windows Services using command prompt

In this post, I am sharing how you can install or uninstall windows services in your local windows system [Windows 10]. Assuming you already built one windows services using C# and want to install it using the command prompt. Follow the below steps to install on your local windows 10 environment:

Step 1: Before you install a windows services you need to generate EXE file. And for generating you need to go to the Visual studio and clean and build your application, which will automatically generate exe file in bin folder.

bin_dubug_exe

Step 2: Open command prompt "as Administrator"

windows_services

Step 3: Navigate to folder "C:\Windows\Microsoft.NET\Framework\v4.0.30319>"

command line

Step 4: For installing you need to run below command:

installutil.exe "E:\Suresh\Projects\TestWindowsService\TestWindowsService\obj\Debug\TestWindowsService.exe"

installing_windows_services

Step 5: Open Run window (Window + R), type in "services.msc", and press enter. A "Services" popup will open.

Step 6: In "Services" popup search for your service name and start it by right click on it.

windows_services_in_Services

Thats All !!!

Now If you want to uninstall it, type the following command:

installutil.exe -u "E:\Suresh\Projects\TestWindowsService\TestWindowsService\obj\Debug\TestWindowsService.exe"

uninstalling_windows_services

Hope it will help someone!!!




Your feedbacks are most welcome..