Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sc.exe how to set up the description for the windows Service?

I am using sc.exe command to install C# windows service.

C:Windows\System32> sc.exe Create "TestService1" binPath= "C:\Program Files (x86)\Test\TestService1" DisplayName= "TestWindowsService1" 

It created service. I was able to start the service. Many Instances I was able to create using sc.exe command

Looking at Services

Name | Description | Status | Start type | Log on As

Description section is blank, I would like to set the descriptionm, Any way to set up description for the service using sc.exe commmand?

like image 225
sivaL Avatar asked Apr 17 '15 14:04

sivaL


People also ask

How do I change a Windows service description?

Service descriptions are kept in the registry under LocalMachine\System\CurrentControlSet\services and then open the key for your service name, one of the keys is Description which holds the description text. Change that and restart the computer.

How do I create a Windows service SC exe?

The SC Create command uses the following format: sc create serviceName binpath= "path\to\service-wrapper-7.4.exe" optionName= optionValue ... where: create is the command to be run by SC (this command name is mandatory to create a service).

What is the sc config command?

Specifies the name of the remote server on which the service is located. The name must use the Universal Naming Convention (UNC) format (for example, \\myserver). To run SC.exe locally, omit this parameter. Specifies the service name returned by the getkeyname operation.


2 Answers

You need to call sc again to set the description. For example:

sc description TestService1 "This is the description of the service.." 

For more information, see here.

like image 147
Donal Avatar answered Sep 29 '22 07:09

Donal


Is not

sc description TestService1 "TestService1" 

as per documentation: https://technet.microsoft.com/en-us/library/cc742069.aspx ?

like image 26
ares777 Avatar answered Sep 29 '22 07:09

ares777