Step 1. Install .NET Framework (I am using .NET 4.0 but you can use any version). If you already have .NET installed on your machine, skip this step.
Step 2. Go to run + cmd then click ok or directly go to your Window command prompt (not visual studio command prompt )
Step 3. To install a Windows Service from command prompt, we can use InstallUtil.exe.
Type this line
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe E:\test\test\bin\Debug\test.exe
Where
1. E:\test\test\bin\Debug\ is the path where you windows service setup created after compiling in Visual Studio.
2. C:\Windows\Microsoft.NET\Framework\v4.0.30319\ is path where InstallUtil.exe exists on your machine.
Make sure to give a space between the InstallUtil.exe and the full path of the service otherwise you will get an error.
Once you hit ENTER, you should see installation messages.
Step 4. If you don't see any error, Enjoy! Your service is installed.
You can confirm by opening your Control Panel > Administrative Tools >Services.
Notes:
1. Run command prompt as administrator
2. Use command with -i switch installutil -i <path of the service.exe file>
Here are complete step by step tutorials:

Guru PrasadPosted Oct 8, 2020, 3:16 AM
C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe C:\test\testservice.exe After successful installation its not displaying the services list. Can you please guide
samir bhattPosted Oct 26, 2018, 6:54 AM
Mahesh Patil , two points to consider 1. run command prompt as administrator 2. use command with -i switch installutil -i <path of the service.exe file>
Javier MedinaPosted Dec 15, 2014, 11:14 PM
Just remember to execute the command prompt as Administrator ...
surabhi kumariPosted Mar 23, 2014, 3:29 AM
Not working
Mahesh PatilPosted Jan 23, 2014, 5:10 AM
Not Working Properly It Gives Error Msg