ChangeStartMode 用法
The ChangeStartMode
WMI class
method modifies the start mode of a Win32_Service
.
This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see Calling a Method
.
Syntax
uint32 ChangeStartMode(
[in] string StartMode
);
Parameters
- StartMode [in]
-
Start mode of the Windows base service.
Value Meaning - Boot
Device driver started by the operating system loader. This value is valid only for driver services.
- System
Device driver started by the operating system initialization process. This value is valid only for driver services.
- Automatic
Service to be started automatically by the Service Control Manager during system startup.(特别需要注意,在检索时间所检索到自启动服务的StartMode为Auto)
- Manual
Service to be started by the Service Control Manager when a process calls the StartService method.
- Disabled
Service that can no longer be started.
Return Value
Returns one of the values listed in the following table or any other value to indicate an error.
Return code | Description |
---|---|
|
Success |
|
Not Supported |
|
Access Denied |
|
Dependent Services Running |
|
Invalid Service Control |
|
Service Cannot Accept Control |
|
Service Not Active |
|
Service Request Timeout |
|
Unknown Failure |
|
Path Not Found |
|
Service Already Running |
|
Service Database Locked |
|
Service Dependency Deleted |
|
Service Dependency Failure |
|
Service Disabled |
|
Service Logon Failure |
|
Service Marked For Deletion |
|
Service No Thread |
|
Status Circular Dependency |
|
Status Duplicate Name |
|
Status Invalid Name |
|
Status Invalid Parameter |
|
Status Invalid Service Account |
|
Status Service Exists |
|
Service Already Paused |