Delete method of the Win32_Service class

The DeleteWMI class method deletes an existing service.

This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see Calling a Method.

Syntax


uint32 Delete();

Parameters

This method has no parameters.

Return value

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 client

Windows XP

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

CIMWin32.mof

DLL

CIMWin32.dll

See also

Operating System Classes
Win32_Service

 

 

Show:
© 2014 Microsoft