Win32_BaseService class

The Win32_BaseService abstract WMI class represents executable objects that are installed in a registry database maintained by the Service Control Manager. The executable file associated with a service can be started at boot time by a boot program or by the system. It can also be started on-demand by the Service Control Manager. Any service or process that is not owned by a specific user, and that provides an interface to some functionality supported by the computer system, is a descendant (or member) of this class.

Example: The dynamic host configuration protocol (DHCP) client service on a computer system running Windows Server.

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

Syntax

[SupportsCreate, CreateBy("Create"), SupportsDelete, DeleteBy("DeleteInstance"), Abstract, Provider("CIMWin32"), UUID("{8502C4C4-5FBB-11D2-AAC1-006008C78BC7}"), DisplayName("System Drivers and Services"), AMENDMENT]
class Win32_BaseService : CIM_Service
{
  boolean  AcceptPause;
  boolean  AcceptStop;
  string   Caption;
  string   CreationClassName;
  string   Description;
  boolean  DesktopInteract;
  string   DisplayName;
  string   ErrorControl;
  uint32   ExitCode;
  datetime InstallDate;
  string   Name;
  string   PathName;
  uint32   ServiceSpecificExitCode;
  string   ServiceType;
  boolean  Started;
  string   StartMode;
  string   StartName;
  string   State;
  string   Status;
  string   SystemCreationClassName;
  string   SystemName;
  uint32   TagId;
};

Members

The Win32_BaseService class has these types of members:

Methods

The Win32_BaseService class has these methods.

Method Description
Change Modifies a service.
ChangeStartMode Modifies the start mode of a service.
Create Creates a new service.
Delete Deletes an existing service.
InterrogateService Requests that the service update its state to the service manager.
PauseService Attempts to place the service in the paused state.
ResumeService Attempts to place the service in the resumed state.
StartService Attempts to place the service into its startup state.
StopService Class method that places the service in the stopped state.
UserControlService Attempts to send a user-defined control code to a service.

Properties

The Win32_BaseService class has these properties.

AcceptPause

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|SERVICE_STATUS|dwControlsAccepted|SERVICE_ACCEPT_PAUSE_CONTINUE"), DisplayName ("Service Accepts Pause")

Service can be paused.

AcceptStop

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|SERVICE_STATUS|dwControlsAccepted|SERVICE_ACCEPT_STOP"), DisplayName ("Service Accepts Stop")

Service can be stopped.

Caption

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64), DisplayName ("Caption")

Short description of the object.

This property is inherited from CIM_ManagedSystemElement.

CreationClassName

Data type: string

Access type: Read-only

Qualifiers: CIM_Key, DisplayName ("Class Name")

Name of the first concrete class to appear in the inheritance chain used in the creation of an instance. When used with the other key properties of the class, the property allows all instances of this class and its subclasses to be uniquely identified.

This property is inherited from CIM_Service.

Description

Data type: string

Access type: Read-only

Qualifiers: DisplayName ("Description")

Description of the object.

This property is inherited from CIM_ManagedSystemElement.

DesktopInteract

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|QUERY_SERVICE_CONFIG|dwServiceType|SERVICE_INTERACTIVE_PROCESS"), DisplayName ("Interacts With Desktop")

Service can create or communicate with windows on the desktop.

DisplayName

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|QUERY_SERVICE_CONFIG|lpDisplayName"), DisplayName ("Display Name")

Display name of the service. This string has a maximum length of 256 characters. The name is case-preserved in the Service Control Manager. Comparisons of DisplayName are always case-insensitive.

Constraints: Accepts the same value as the Name property.

Example: "Atdisk"

ErrorControl

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|QUERY_SERVICE_CONFIG|dwErrorControl"), DisplayName ("Severity Of Startup Failure")

Severity of the error. Service fails to start. The value indicates the action taken by the startup program if failure occurs. All errors are logged by the computer system.

Ignore ("Ignore")

User is not notified.

Normal ("Normal")

User is notified.

Severe ("Severe")

System restarted with the last-known-good configuration.

Critical ("Critical")

System attempts to restart with a good configuration.

Unknown ("Unknown")

Action taken is unspecified.

ExitCode

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|SERVICE_STATUS|dwWin32ExitCode"), DisplayName ("Exit Code")

Defining any problems encountered in starting or stopping the service. This property is set to ERROR_SERVICE_SPECIFIC_ERROR (1066) when the error is unique to the service represented by this class, and information about the error is available in the ServiceSpecificExitCode property. The service sets this value to NO_ERROR when running, and again upon normal termination.

InstallDate

Data type: datetime

Access type: Read-only

Qualifiers: MappingStrings ("MIF.DMTF|ComponentID|001.5"), DisplayName ("Install Date")

Object was installed. This property does not need a value to indicate that the object is installed.

This property is inherited from CIM_ManagedSystemElement.

Name

Data type: string

Access type: Read-only

Qualifiers: Key

Unique identifier of the service, which provides an indication of the functionality that is managed. This functionality is described in more detail in the object's Description property.

This property is inherited from CIM_ManagedSystemElement.

PathName

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|QUERY_SERVICE_CONFIG|lpBinaryPathName"), DisplayName ("File Path Name")

Fully qualified path to the service binary file that implements the service.

Example: "\SystemRoot\System32\drivers\afd.sys"

ServiceSpecificExitCode

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|SERVICE_STATUS|dwServiceSpecificExitCode"), DisplayName ("Server Specific Exit Code")

Service-specific error code for errors that occur while the service is either starting or stopping. The exit codes are defined by the service represented by this class. This value is only set when the ExitCodeproperty value is ERROR_SERVICE_SPECIFIC_ERROR (1066).

ServiceType

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|QUERY_SERVICE_CONFIG|dwServiceType"), DisplayName ("Service Type")

Service provided to calling processes.

Kernel Driver ("Kernel Driver")

File System Driver ("File System Driver")

Adapter ("Adapter")

Recognizer Driver ("Recognizer Driver")

Own Process ("Own Process")

Share Process ("Share Process")

Interactive Process ("Interactive Process")

Started

Data type: boolean

Access type: Read-only

Qualifiers: DisplayName ("Started")

Service has been started.

This property is inherited from CIM_Service.

StartMode

Data type: string

Access type: Read-only

Qualifiers: Override ("StartMode"), DisplayName ("Start Mode")

Start mode of the Windows base service.

This property is inherited from CIM_Service.

Boot ("Boot")

Device driver started by the operating system loader (valid only for driver services).

System ("System")

Device driver started by the operating system initialization process. This value is valid only for driver services.

Auto ("Auto")

Service to be started automatically by the service control manager during system start up.

Manual ("Manual")

Service to be started by the service control manager when a process calls the StartService method.

Disabled ("Disabled")

Service that can no longer be started.

StartName

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|QUERY_SERVICE_CONFIG|lpServiceStartName"), DisplayName ("Starting Account Name")

Account name under which the service runs. Depending on the service type, the account name may be in the form of "DomainName\Username" or UPN format (Username@DomainName). The service process will be logged using one of these two forms when it runs. If the account belongs to the built-in domain, ".\Username" can be specified. If NULL is specified, the service will be logged on as the LocalSystem account. For kernel or system-level drivers, StartName contains the driver object name (that is, \FileSystem\Rdr or \Driver\Xns) which the input and output (I/O) system uses to load the device driver. Additionally, if NULL is specified, the driver runs with a default object name created by the I/O system based on the service name. Example: "DWDOM\Admin".

State

Data type: string

Access type: Read/write

Qualifiers: MappingStrings ("Win32API|Service Structures|SERVICE_STATUS|dwCurrentState "), DisplayName ("State")

Current state of the base service.

Stopped ("Stopped")

Start Pending ("Start Pending")

Stop Pending ("Stop Pending")

Running ("Running")

Continue Pending ("Continue Pending")

Pause Pending ("Pause Pending")

Paused ("Paused")

Unknown ("Unknown")

Windows Server 2008 and Windows Vista: This property is read-only.

Status

Data type: string

Access type: Read-only

Qualifiers: MaxLen (10), DisplayName ("Status")

Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is online, yet the managed element is neither "OK" nor in one of the other states.

This property is inherited from CIM_ManagedSystemElement.

Values include the following:

OK ("OK")

Error ("Error")

Degraded ("Degraded")

Unknown ("Unknown")

Pred Fail ("Pred Fail")

Starting ("Starting")

Stopping ("Stopping")

Service ("Service")

Stressed ("Stressed")

NonRecover ("NonRecover")

No Contact ("No Contact")

Lost Comm ("Lost Comm")

SystemCreationClassName

Data type: string

Access type: Read-only

Qualifiers: Propagated ("CIM_System.CreationClassName"), CIM_Key, DisplayName ("System Class Name")

Type name of the system that hosts this service.

This property is inherited from CIM_Service.

SystemName

Data type: string

Access type: Read-only

Qualifiers: Propagated ("CIM_System.Name"), CIM_Key, DisplayName ("System Name")

Name of the system that hosts this service.

This property is inherited from CIM_Service.

TagId

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32API|Service Structures|QUERY_SERVICE_CONFIG|dwTagId"), DisplayName ("Tag Id")

Unique tag value for this service in the group. A value of 0 (zero) indicates that the service has not been assigned a tag. A tag can be used for ordering service star tup within a load order group by specifying a tag order vector in the registry located at: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GroupOrderList. Tags are only evaluated for Kernel Driver and File System Driver start-type services that have Boot or System start modes.

Remarks

The Win32_BaseService class is derived from CIM_Service.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMV2
MOF
CIMWin32.mof
DLL
CIMWin32.dll

See also

CIM_Service

Operating System Classes