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.
Step 2: Open command prompt "as Administrator"
Step 3: Navigate to folder "C:\Windows\Microsoft.NET\Framework\v4.0.30319>"
Step 4: For installing you need to run below command:
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.
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"
Hope it will help someone!!!