Getting Operating System Information

Applies to TestComplete 15.59, last modified on November 30, 2023

TestComplete lets you check the Windows version, bitness and other information in your automated tests. This way, you can, for example, run some operations only on a specific Windows version.

To get Windows information, use the following objects:

  • Sys.OSInfo - contains the Windows version, edition, bitness, service packs and other information.

  • aqEnvironment - contains environment variables, locale info and Windows build numbers.

The example below checks Windows bitness (32-bit or 64-bit):

JavaScript, JScript

function Test()
  if (Sys.OSInfo.Windows64bit)
    Log.Message("You have 64-bit Windows.");
    Log.Message("You have 32-bit Windows.");


def Test():
  if Sys.OSInfo.Windows64bit:
    Log.Message("You have 64-bit Windows.")
    Log.Message("You have 32-bit Windows.")


Sub Test
  If Sys.OSInfo.Windows64bit Then
    Log.Message "You have 64-bit Windows."
    Log.Message "You have 32-bit Windows."
  End If
End Sub


procedure Test;
  if Sys.OSInfo.Windows64bit then
    Log.Message('You have 64-bit Windows.')
    Log.Message('You have 32-bit Windows.');

C++Script, C#Script

function Test()
  if (Sys["OSInfo"]["Windows64bit"])
    Log["Message"]("You have 64-bit Windows.")
    Log["Message"]("You have 32-bit Windows.")

See Also

aqEnvironment Object
OSInfo Object
Running Tests on Multiple Operating Systems

Highlight search results