Search code examples
c#windows-services

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 the 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 description. Any way to set up description for the service using sc.exe commmand?


Solution

  • 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 Sc Description command.