aqEnvironment.GetWinMinorVersion Method

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

Use the GetWinMinorVersion method to determine the minor version of the operating system that is installed on your computer and is currently running.

Declaration

aqEnvironment.GetWinMinorVersion()

Result Integer

Applies To

The method is applied to the following object:

Result Value

One of the following values:

Value Description
0 Windows 10, Windows Server 2016, or Windows Server 2019
1 Windows 7, Windows Server 2008 R2
2 Windows Server 2012

Example

The following code demonstrates how you can obtain additional information about the operating system you are currently using.

JavaScript, JScript

function OSInformation()
{
 // Gets additional information about your operating system
 var AddInfo = aqEnvironment.GetWinAdditionalInfo();
 Log.Message("You are using Microsoft Windows operating system with the " + AddInfo + " installed");

 // Gets information about your operating system's major version
 var MajVer = aqEnvironment.GetWinMajorVersion();
 // Gets information about your operating system's minor version
 var MinVer = aqEnvironment.GetWinMinorVersion();
 // Gets information about your operating system's build number
 var Build = aqEnvironment.GetWinVersionBuild();
 // Posts the information about your system to the test log
 Log.Message("The OS version you are using is " + MajVer + "." + MinVer + "." + Build );
}

Python

def OSInformation():
  # Gets additional information about your operating system
  AddInfo = aqEnvironment.GetWinAdditionalInfo()
  Log.Message("You are using Microsoft Windows operating system with the " + AddInfo + " installed")
  # Gets information about your operating system's major version
  MajVer = aqEnvironment.GetWinMajorVersion()
  # Gets information about your operating system's minor version
  MinVer = aqEnvironment.GetWinMinorVersion()
  # Gets information about your operating system's build number
  Build = aqEnvironment.GetWinVersionBuild()
  # Posts the information about your system to the test log
  Log.Message("The OS version you are using is " + str(MajVer) + "." + str(MinVer) + "." + str(Build) )

VBScript

Sub OSInformation


 ' Gets additional information about your operating system
 AddInfo = aqEnvironment.GetWinAdditionalInfo()
 Call Log.Message("You are using Microsoft Windows operating system with the " + AddInfo + " installed")

 ' Gets information about your operating system's major version
 MajVerNum = aqEnvironment.GetWinMajorVersion()
 ' Converts the version number to a string
 MajVerStr = aqConvert.IntToStr(MajVerNum)

 ' Gets information about your operating system's minor version
 MinVerNum = aqEnvironment.GetWinMinorVersion()
 ' Converts the version number to a string
 MinVerStr = aqConvert.IntToStr(MinVerNum)

 ' Gets information about your operating system's build number
 BuildNum = aqEnvironment.GetWinVersionBuild()
 ' Converts the build number to a string
 BuildStr = aqConvert.IntToStr(BuildNum)

 ' Posts the information about your system to the test log
 Call Log.Message("The OS version you are using is " + MajVerStr + "." + MinVerStr + "." + BuildStr)

End Sub

DelphiScript

function OSInformation;
var AddInfo, MajVerNum, MajVerStr, MinVerNum, MinVerStr, BuildNum, Buildstr;
begin

 // Gets additional information about your operating system
 AddInfo := aqEnvironment.GetWinAdditionalInfo();
 Log.Message('You are using Microsoft Windows operating system with the ' + AddInfo + ' installed');

 // Gets information about your operating system's major version
 MajVerNum := aqEnvironment.GetWinMajorVersion();
 // Converts the version number to a string
 MajVerStr := aqConvert.IntToStr(MajVerNum);
 // Gets information about your operating system's minor version
 MinjVerNum := aqEnvironment.GetWinMinorVersion();
 // Converts the version number to a string
 MinVerStr := aqConvert.IntToStr(MinVerNum);
 // Gets information about your operating system's build number
 BuildNum := aqEnvironment.GetWinVersionBuild();
 // Converts the build number to a string
 BuildStr := aqConvert.IntToStr(BuildNum);
 // Posts the information about your system to the test log
 Log.Message('The OS version you are using is ' + MajVerStr + '.' + MinVerStr + '.' + BuildStr);

end;

C++Script, C#Script

function OSInformation()
{
 // Gets additional information about your operating system
 var AddInfo = aqEnvironment["GetWinAdditionalInfo"]();
 Log["Message"]("You are using Microsoft Windows operating system with the " + AddInfo + " installed");

 // Gets information about your operating system's major version
 var MajVer = aqEnvironment["GetWinMajorVersion"]();
 // Gets information about your operating system's minor version
 var MinVer = aqEnvironment["GetWinMinorVersion"]();
 // Gets information about your operating system's build number
 var Build = aqEnvironment["GetWinVersionBuild"]();
 // Posts the information about your system to the test log
 Log["Message"]("The OS version you are using is " + MajVer + "." + MinVer + "." + Build );
}

See Also

GetWinMajorVersion Method
GetWinAdditionalInfo Method
GetWinVersionBuild Method
Version Property

Highlight search results