WMI.Service Property

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

The WMI object is a wrapper over the operating system’s SWbemServices object that provides a scripting interface to the WMI functionality on a computer. The Service property returns a reference to the SWbemServices object that is connected to the WMI object.

Declaration

WMI.Service

Read-Only Property The SWbemServices object

Applies To

The property is applied to the following object:

Property Value

A reference to the SWbemServices object.

Remarks

For detailed information on the SWbemServices object, its methods and properties, see the documentation in the SWbemServices object article of the MSDN Library. Refer to the MSDN Library for more information on scripting API for WMI.

Example

Below is sample code that demonstrates how you can use the Service method to access the operating system’s SWbemServices object:

JavaScript, JScript

WmiService = WMI.Service;

Python

WmiService = WMI.Service

VBScript

Set WmiService = WMI.Service

DelphiScript

WmiService := WMI.Service;

C++Script, C#Script

WmiService = WMI["Service"];

See Also

ComputerName Property
ConnectToComputer Method

Highlight search results