且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用 c/c++ 启动/停止名称中有空格的 Windows 服务

更新时间:2022-04-16 01:52:04

您需要使用服务的内部名称(没有空格),而不是显示名称(可能).

You need to use the service's internal name (which has no spaces), not the display name (which may).

来自 MSDN一个>:

要打开的服务的名称.这是创建服务对象时 CreateService 函数的 lpServiceName 参数指定的名称,不是用户界面应用程序显示的服务显示名称识别服务.

The name of the service to be opened. This is the name specified by the lpServiceName parameter of the CreateService function when the service object was created, not the service display name that is shown by user interface applications to identify the service.