WMI.PostEnvironmentVariableInfo Method

Applies to TestComplete 15.45, last modified on December 01, 2022

Description

The method uses the WMI services to obtain information about environment variables defined on the computer specified by the WMI.ComputerName property and posts this information to the test log.

Declaration

WMI.PostEnvironmentVariableInfo()

Result None

Applies To

The method is applied to the following object:

Result Value

None.

Example

The following example demonstrates how to connect to the WMI service on a local computer and post different information about the computer to the log.

JavaScript, JScript

function Test()
{
  // Specifies the local computer using the ComputerName property
  WMI.ComputerName = ".";

  // Using the ConnectToComputer method
  // WMI.ConnectToComputer(".", "", "");


  // Using the WaitForComputer method
  // WMI.WaitForComputer(".", "", "", 1000000);

  // Posts different information about the computer to the log
  WMI.PostProcessorInfo();
  WMI.PostDrivesInfo();
  WMI.PostInstalledAppsInfo();
  WMI.PostEnvironmentVariableInfo();
  WMI.MaxEventCount = 5;
  WMI.PostEventsInfo();
}

Python

def Test1():
  # Specifies the local computer using the ComputerName property
  WMI.ComputerName = "."

  # Using the ConnectToComputer method
  #WMI.ConnectToComputer(".", "", "");

  # Using the WaitForComputer method
  #WMI.WaitForComputer(".", "", "", 1000000);

  # Posts different information about the computer to the log
  WMI.PostProcessorInfo();
  WMI.PostDrivesInfo();
  WMI.PostInstalledAppsInfo();
  WMI.PostEnvironmentVariableInfo();
  WMI.MaxEventCount = 5;
  WMI.PostEventsInfo();

VBScript

Sub Test
  ' Specifies the local computer using the ComputerName property
  WMI.ComputerName = "."

  ' Using the ConnectToComputer method
  ' Call WMI.ConnectToComputer(".", "", "")


  ' Using the WaitForComputer method
  ' Call WMI.WaitForComputer(".", "", "", 1000000)

  ' Posts different information about the computer to the log
  Call WMI.PostProcessorInfo
  Call WMI.PostDrivesInfo
  Call WMI.PostInstalledAppsInfo
  Call WMI.PostEnvironmentVariableInfo
  WMI.MaxEventCount = 5
  Call WMI.PostEventsInfo
End Sub

DelphiScript

procedure Test;
begin
  // Specifies the local computer using the ComputerName property
  WMI.ComputerName := '.';

  // Using the ConnectToComputer method
  // WMI.ConnectToComputer('.', '', '');


  // Using the WaitForComputer method
  // WMI.WaitForComputer('.', '', '', 1000000);

  // Posts different information about the computer to the log
  WMI.PostProcessorInfo;
  WMI.PostDrivesInfo;
  WMI.PostInstalledAppsInfo;
  WMI.PostEnvironmentVariableInfo;
  WMI.MaxEventCount := 5;
  WMI.PostEventsInfo;
end;

C++Script, C#Script

function Test()
{
  // Specifies the local computer using the ComputerName property
  WMI["ComputerName"] = ".";

  // Using the ConnectToComputer method
  // WMI["ConnectToComputer"](".", "", "");


  // Using the WaitForComputer method
  // WMI["WaitForComputer"](".", "", "", 1000000);

  // Posts different information about the computer to the log
  WMI["PostProcessorInfo"]();
  WMI["PostDrivesInfo"]();
  WMI["PostInstalledAppsInfo"]();
  WMI["PostEnvironmentVariableInfo"]();
  WMI["MaxEventCount"] = 5;
  WMI["PostEventsInfo"]();
}

See Also

ComputerName Property
GetEnvironmentVariable Method

Highlight search results