Share via


Win32_ServiceControl class

The Win32_ServiceControl WMI class represents instructions for controlling installed and uninstalled services.

Note

For more information about support or requirements for installation on a specific operating system, see Operating System Availability of WMI Components.

The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties. Properties and methods are in alphabetic order, not MOF order.

Syntax

[Provider("MSIProv"), Dynamic]
class Win32_ServiceControl : Win32_MSIResource
{
  string Arguments;
  string Caption;
  string Description;
  string Event;
  string ID;
  string Name;
  string ProductCode;
  string SettingID;
  unit16 Wait;
};

Members

The Win32_ServiceControl class has these types of members:

Properties

The Win32_ServiceControl class has these properties.

Arguments

Data type: string

Access type: Read-only

List of arguments for starting services. The arguments are separated by null characters [~]. For example, the list of arguments One, Two, and Three are listed as the following: "One[~]Two[~]Three".

Caption

Data type: string

Access type: Read-only

Short textual description of the CIM_Setting object a one-line string.

Description

Data type: string

Access type: Read-only

Description of the CIM_Setting object.

Event

Data type: string

Access type: Read-only

Bitmap that represents the operations for which this object applies. Decimal value is noted in parentheses.

Value used to set the bit Meaning
1 (0x1)
Starts the service during the StartServices action.
2 (0x2)
Stops the service during the StopServices action.
4 (0x4)
<reserved>
8 (0x8)
Deletes the service during the DeleteServices action.

The following values are only used during an uninstall.

Value Meaning
16 (0x10)
Starts the service during the StartServices action.
32 (0x20)
Stops the service during the StopServices action.
64 (0x40)
<reserved>
128 (0x80)
Deletes the service during the DeleteServices action.

ID

Data type: string

Access type: Read-only

Qualifiers: Key, Dynamic

Unique key that identifies a service control item within its product.

Name

Data type: string

Access type: Read-only

Name used to identify a software element.

ProductCode

Data type: string

Access type: Read-only

Product code for the product of which this service control is a part.

SettingID

Data type: string

Access type: Read-only

Identifier for the CIM_Setting object.

Wait

Data type: unit16

Access type: Read-only

Waiting time before action is taken. A value of 1 (one) in this column means to wait until the service actually completes before proceeding. This implies that the event is critical to the install, and that if the event fails the error cannot be ignored. A value of 0 (zero) in this column means to wait only until the service control manager (SCM) reports that this service is in a pending state.

Remarks

The Win32_ServiceControl class is derived from Win32_MSIResource.

Requirements

Minimum supported client
Windows XP
Minimum supported server
Windows Server 2003
Namespace
Root\CIMV2
MOF
Msi.mof
DLL
Msiprov.dll

See also

Installed Applications Classes