CompanyName Property

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

Description

The CompanyName property allows you to get the name of the company that produced the file.

Declaration

aqFileVersionInfoObj.CompanyName(Index)

Read-Only Property String
aqFileVersionInfoObj An expression, variable or parameter that specifies a reference to an aqFileVersionInfo object
Index [in]    Optional    Integer Default value: 0   

Applies To

The property is applied to the following object:

Parameters

The property has the following parameter:

Index

A file can contain multiple version information blocks translated in different languages. This parameter specifies a zero-based index of the desired version information translation, among those included in the file. The default value is 0, which means the default version information block. To get the total number of version information translations in a file, use the Languages property.

Property Value

A string that contains the company name.

Remarks

If you use Python or DelphiScript, you should enclose the parameter of the CompanyName property in square brackets: CompanyName[Index].

Example

The following code snippet logs the CompanyName value of Notepad’s version information:

JavaScript, JScript

function VersionInfoSample()
{
  var FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe";
  var VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo;

  Log.Message("Company name: " + VerInfo.CompanyName);
}

Python

def VersionInfoSample():
  FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe"
  VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo
  Log.Message("Company name: " + str(VerInfo.CompanyName[0]))

VBScript

Sub VersionInfoSample
  Dim FileName, VerInfo

  FileName = Sys.OSInfo.WindowsDirectory & "\notepad.exe"
  Set VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo

  Log.Message "Company name: " & VerInfo.CompanyName
End Sub

DelphiScript

procedure VersionInfoSample;
var FileName, VerInfo;
begin
  FileName := Sys.OSInfo.WindowsDirectory + '\notepad.exe';
  VerInfo := aqFileSystem.GetFileInfo(FileName).VersionInfo;

  Log.Message('Company name: ' + VerInfo.CompanyName);
end;

C++Script, C#Script

function VersionInfoSample()
{
  var FileName = Sys["OSInfo"]["WindowsDirectory"] + "\\notepad.exe";
  var VerInfo = aqFileSystem["GetFileInfo"](FileName)["VersionInfo"];

  Log["Message"]("Company name: " + VerInfo["CompanyName"]);
}

See Also

ProductName Property
LegalCopyright Property
LegalTrademarks Property
Languages Property

Highlight search results