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

sivaL picture sivaL · Apr 17, 2015 · Viewed 31.4k times · Source

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?

Answer

Donal picture Donal · Apr 17, 2015

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.