OSFile Property

Applies to TestComplete 15.0, last modified on November 17, 2021

Description

Use the OSFile property to determine the operating system that the file was designed for.

Declaration

aqFileVersionInfoObj.OSFile

Read-Only Property Integer
aqFileVersionInfoObj An expression, variable or parameter that specifies a reference to an aqFileVersionInfo object

Applies To

The property is applied to the following object:

Property Value

One of the following constants defined in the Win32API object:

Constant Value Description
VOS_UNKNOWN 0 Unknown operating system.
VOS__WINDOWS16 1 16-bit Microsoft Windows.
VOS__PM16 2 16-bit Presentation Manager.
VOS__PM32 3 32-bit Presentation Manager.
VOS__WINDOWS32 4 32-bit Windows.
VOS_DOS 65536 Microsoft DOS.
VOS_DOS_WINDOWS16 65537 16-bit Windows running on MS-DOS.
VOS_DOS_WINDOWS32 65540 32-bit Windows running on MS-DOS.
VOS_OS216 131072 16-bit OS/2.
VOS_OS216_PM16 131074 16-bit Presentation Manager running on 16-bit OS/2.
VOS_OS232 196608 32-bit OS/2.
VOS_OS232_PM32 196611 32-bit Presentation Manager running on 32-bit OS/2.
VOS_NT 262144 Windows NT.
VOS_NT_WINDOWS32 262148 Windows NT.

Example

The code below determines the type of the operating system that the specified file was designed for.

JavaScript, JScript

function OSInfoSample()
{
  var FileName = "C:\\Documents and Settings\\All Users\\Documents\\TestComplete 15 Samples\\Desktop\\Orders\\C#\\bin\\Release\\Orders.exe"
  var VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo;

  Log.Message("The operating system type: " + GetOSTypeStr(VerInfo.OSFile));
}

function GetOSTypeStr(OSType)
{
  switch (OSType)
  {
    case VOS__WINDOWS16 : return "16-bit Microsoft Windows";
    case VOS__PM16 : return "16-bit Presentation Manager";
    case VOS__PM32 : return "32-bit Presentation Manager";
    case VOS__WINDOWS32 : return "32-bit Windows";
    case VOS_DOS : return "Microsoft DOS";
    case VOS_DOS_WINDOWS16 : return "16-bit Windows running on MS-DOS";
    case VOS_DOS_WINDOWS32 : return "32-bit Windows running on MS-DOS";
    case VOS_OS216 : return "16-bit OS/2";
    case VOS_OS216_PM16 : return "16-bit Presentation Manager running on 16-bit OS/2";
    case VOS_OS232 : return "32-bit OS/2";
    case VOS_OS232_PM32 : return "32-bit Presentation Manager running on 32-bit OS/2";
    default: return "Unknown";
  }
}

Python

def OSInfoSample():
  FileName = "C:\\Documents and Settings\\All Users\\Documents\\TestComplete 11 Samples\\Desktop\\Orders\\C#\\bin\\Release\\Orders.exe"
  VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo
  Log.Message("The operating system type: " + GetOSTypeStr(VerInfo.OSFile))

def GetOSTypeStr(OSType):
  if OSType == VOS__WINDOWS16:
    return "16-bit Microsoft Windows"
  elif OSType == VOS__PM16:
    return "16-bit Presentation Manager"
  elif OSType == VOS__PM32:
    return "32-bit Presentation Manager"
  elif OSType == VOS__WINDOWS32:
    return "32-bit Windows"
  elif OSType == VOS_DOS:
    return "Microsoft DOS"
  elif OSType == VOS_DOS_WINDOWS16:
    return "16-bit Windows running on MS-DOS"
  elif OSType == VOS_DOS_WINDOWS32:
    return "32-bit Windows running on MS-DOS"
  elif OSType == VOS_OS216:
    return "16-bit OS/2"
  elif OSType == VOS_OS216_PM16:
    return "16-bit Presentation Manager running on 16-bit OS/2"
  elif OSType == VOS_OS232:
    return "32-bit OS/2"
  elif OSType == VOS_OS232_PM32:
    return "32-bit Presentation Manager running on 32-bit OS/2";
  else:
    return "Unknown"

VBScript

Sub OSInfoSample
  Dim FileName, VerInfo

  FileName = "C:\Documents and Settings\All Users\Documents\TestComplete 15 Samples\Desktop\Orders\C#\bin\Release\Orders.exe"
  Set VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo

  Log.Message "The operating system type: " & GetOSTypeStr(VerInfo.OSFile)
End Sub

Function GetOSTypeStr(OSType)
  Select Case OSType
    Case VOS__WINDOWS16 GetOSTypeStr = "16-bit Microsoft Windows"
    Case VOS__PM16 GetOSTypeStr = "16-bit Presentation Manager"
    Case VOS__PM32 GetOSTypeStr = "32-bit Presentation Manager"
    Case VOS__WINDOWS32 GetOSTypeStr = "32-bit Windows"
    Case VOS_DOS GetOSTypeStr = "Microsoft DOS"
    Case VOS_DOS_WINDOWS16 GetOSTypeStr = "16-bit Windows running on MS-DOS"
    Case VOS_DOS_WINDOWS32 GetOSTypeStr = "32-bit Windows running on MS-DOS"
    Case VOS_OS216 GetOSTypeStr = "16-bit OS/2"
    Case VOS_OS216_PM16 GetOSTypeStr = "16-bit Presentation Manager running on 16-bit OS/2"
    Case VOS_OS232 GetOSTypeStr = "32-bit OS/2"
    Case VOS_OS232_PM32 GetOSTypeStr = "32-bit Presentation Manager running on 32-bit OS/2"
    Case Else GetOSTypeStr = "Unknown"
  End Select
End Function

DelphiScript

function GetOSTypeStr(OSType);
begin
  case OSType of
    VOS__WINDOWS16 : Result := '16-bit Microsoft Windows';
    VOS__PM16 : Result := '16-bit Presentation Manager';
    VOS__PM32 : Result := '32-bit Presentation Manager';
    VOS__WINDOWS32 : Result := '32-bit Windows';
    VOS_DOS : Result := 'Microsoft DOS';
    VOS_DOS_WINDOWS16 : Result := '16-bit Windows running on MS-DOS';
    VOS_DOS_WINDOWS32 : Result := '32-bit Windows running on MS-DOS';
    VOS_OS216 : Result := '16-bit OS/2';
    VOS_OS216_PM16 : Result := '16-bit Presentation Manager running on 16-bit OS/2';
    VOS_OS232 : Result := '32-bit OS/2';
    VOS_OS232_PM32 : Result := '32-bit Presentation Manager running on 32-bit OS/2';
  else
    Result := 'Unknown';
  end;
end;

procedure OSInfoSample;
var FileName, VerInfo;
begin
  FileName := 'C:\Documents and Settings\All Users\Documents\TestComplete 15 Samples\Desktop\Orders\C#\bin\Release\Orders.exe';
  VerInfo := aqFileSystem.GetFileInfo(FileName).VersionInfo;

  Log.Message('The operating system type: ' + GetOSTypeStr(VerInfo.OSFile));
end;

C++Script, C#Script

function OSInfoSample()
{
  var FileName = "C:\\Documents and Settings\\All Users\\Documents\\TestComplete 15 Samples\\Desktop\\Orders\\C#\\bin\\Release\\Orders.exe"
  var VerInfo = aqFileSystem["GetFileInfo"](FileName)["VersionInfo"];

  Log["Message"]("The operating system type: " + GetOSTypeStr( VerInfo["OSFile"] ));
}

function GetOSTypeStr(OSType)
{
  switch (OSType)
  {
    case VOS__WINDOWS16 : return "16-bit Microsoft Windows";
    case VOS__PM16 : return "16-bit Presentation Manager";
    case VOS__PM32 : return "32-bit Presentation Manager";
    case VOS__WINDOWS32 : return "32-bit Windows";
    case VOS_DOS : return "Microsoft DOS";
    case VOS_DOS_WINDOWS16 : return "16-bit Windows running on MS-DOS";
    case VOS_DOS_WINDOWS32 : return "32-bit Windows running on MS-DOS";
    case VOS_OS216 : return "16-bit OS/2";
    case VOS_OS216_PM16 : return "16-bit Presentation Manager running on 16-bit OS/2";
    case VOS_OS232 : return "32-bit OS/2";
    case VOS_OS232_PM32 : return "32-bit Presentation Manager running on 32-bit OS/2";
    default: return "Unknown";
  }
}

See Also

FileType Property
FileSubType Property

Highlight search results