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?
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.
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).
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.
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.
Is not
sc description TestService1 "TestService1"
as per documentation: https://technet.microsoft.com/en-us/library/cc742069.aspx ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With