WMI.Service Property

Applies to TestComplete 15.42, last modified on August 01, 2022


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.



Read-Only Property The SWbemServices object

Applies To

The property is applied to the following object:

Property Value

A reference to the SWbemServices object.


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.


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;


WmiService = WMI.Service


Set WmiService = WMI.Service


WmiService := WMI.Service;

C++Script, C#Script

WmiService = WMI["Service"];

See Also

ComputerName Property
ConnectToComputer Method

Highlight search results