ChangeStartMode Method of the Win32_Service Class
ChangeStartMode Method of the Win32_Service Class

The ChangeStartModeWMI 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.

ValueMeaning
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.

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 codeDescription
0

Success

1

Not Supported

2

Access Denied

3

Dependent Services Running

4

Invalid Service Control

5

Service Cannot Accept Control

6

Service Not Active

7

Service Request Timeout

8

Unknown Failure

9

Path Not Found

10

Service Already Running

11

Service Database Locked

12

Service Dependency Deleted

13

Service Dependency Failure

14

Service Disabled

15

Service Logon Failure

16

Service Marked For Deletion

17

Service No Thread

18

Status Circular Dependency

19

Status Duplicate Name

20

Status Invalid Name

21

Status Invalid Parameter

22

Status Invalid Service Account

23

Status Service Exists

24

Service Already Paused

 

Examples

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
MOFCimwin32.mof
DLLCimwin32.dll
Namespace\root\cimv2

See Also

Operating System Classes
Win32_Service

Send comments about this topic to Microsoft

Build date: 11/3/2009

Community Content

Isn't it strange?
Added by:t-boh

Why do we have to use "Automatic" when calling this function while the property "StartMode" returns only "Auto"? Isn't it strange?

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View