Run The Windows Service Using Command Prompt

Mostly, we write the code for Windows Service very simply. At the time of hosting the Windows Service, many struggle in the first Service hosting. I think this following blog will be useful for those people.

Windows Service is just the code without the UI, which is always running in the background and triggering the coded task in a particular time interval. Normally, so many default Microsoft Windows Services are running in the background, which we can see by typing the Services.msc and entering,

Subsequently, you can view the services, which are all currently running.

Below, I have explained How to Install the Windows Service, using command prompt.

First, we need to locate the InstallUtil.exe, which is used to Install the Windows Service, using Windows system via command prompt.

It comes with Windows internally in the folder, given below..

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

First in the command prompt, we need to change the directory to the folder structure given above, using cd command, as shown below.