简体   繁体   中英

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"

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

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

Is not

sc description TestService1 "TestService1"

For those experiencing "A positional parameter cannot be found that accepts argument" (PositionalParameterNotFound) error while trying to use the "sc description" command, replace sc with sc.exe. Apparently it fixes the problem, although the "sc create" command works as expected, without .exe

"

sc.exe "TestService1" description "This is my service description"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM