InternalName Property

Applies to TestComplete 14.93, last modified on October 12, 2021

Description

Use the InternalName property to get the internal name of the file, if any.

Declaration

aqFileVersionInfoObj.InternalName(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 holds the file’s internal name. If none exists, the property returns the file’s original name (the OriginalFilename value) without the extension.

Remarks

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

Example

The code below obtains the NOTEPAD.EXE internal name and posts it to the test log.

JavaScript, JScript

function FileInternalNameSample()
{

  // Specifies the file's name
  var FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe";
  
  // Obtains information about the file's version
  var VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo;

  // Posts the file's internal name to the test log
  Log.Message(VerInfo.InternalName(0));
  
}

/*
The routine produces the following output:

Notepad
*/

Python

def FileInternalNameSample():
  # Specifies the file's name
  FileName = Sys.OSInfo.WindowsDirectory + "\\notepad.exe"
  # Obtains information about the file's version
  VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo
  # Posts the file's internal name to the test log
  Log.Message(VerInfo.InternalName[0])

# The routine produces the following output:
# Notepad

VBScript

Sub FileInternalNameSample

  Dim FileName, VerInfo

  ' Specifies the file's name
  FileName = Sys.OSInfo.WindowsDirectory & "\notepad.exe"
  
  ' Obtains information about the file's version
  Set VerInfo = aqFileSystem.GetFileInfo(FileName).VersionInfo

  ' Posts the file's internal name to the test log
  Log.Message VerInfo.InternalName(0)
  
End Sub

' The routine produces the following output:
' Notepad

DelphiScript

function FileInternalNameSample;
var FileName, VerInfo;
begin

  // Specifies the file's name
  FileName := Sys.OSInfo.WindowsDirectory + '\notepad.exe';
  
  // Obtains information about the file's version
   VerInfo := aqFileSystem.GetFileInfo(FileName).VersionInfo;

  // Posts the file's internal name to the test log
  Log.Message(VerInfo.InternalName(0));
  
end;

{
The routine produces the following output:

Notepad
}

C++Script, C#Script

function FileInternalNameSample()
{

  // Specifies the file's name
  var FileName = Sys["OSInfo"]["WindowsDirectory"] + "\\notepad.exe";
  
  // Obtains information about the file's version
  var VerInfo = aqFileSystem["GetFileInfo"](FileName)["VersionInfo"];

  // Posts the file's internal name to the test log
  Log["Message"]( VerInfo["InternalName"](0) );
  
}

/*
The routine produces the following output:

Notepad
*/

See Also

OriginalFilename Property
Languages Property

Highlight search results