comment 0

Install a service on Windows Server 2008

Install a service on Windows Server 2008

I created a service in Visual Studio to monitor some stuff for me. I wanted the process to run about every 10 minutes. I struggled a little to figure out how to install the service. I have seen some suggestions to use installutil but I could not find it on the server. I then discovered the sc command that would install the service for me as well as do a whole host of other things.

To install the service you can simply open a command window (probably best if run as administrator).

Then type the following:  sc create  NewService.ServiceName binpath= c:\pathtotheprogram.exe displayname= NewService.ServiceName

 

One thing to be aware of is the create statement actually creates a service named NewService.ServiceName so if you want to remove it later you will need the whole name.

 

So to remove the service type the following: sc delete NewService.ServiceName

In both cases you should see a confirmation that the service has been created or deleted.

 

 

 

Leave a Reply

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