ShortPath Property

Applies to TestComplete 15.48, last modified on March 01, 2023

Description

The ShortPath property holds a short version of the folder path. If this format is used, folder names do not exceed 8 characters. This naming convention was adopted in MS-DOS.

Declaration

aqFolderInfoObj.ShortPath

Read-Only Property String
aqFolderInfoObj An expression, variable or parameter that specifies a reference to an aqFolderInfo object

Applies To

The property is applied to the following object:

Property Value

A string containing the short path to the specified folder.

Example

The code below obtains the short name of the specified folder, converts this name to the 8.3 format and then posts it to the test log.

JavaScript, JScript

function ShortPathExample()
{

  // Specifies the fully qualified name of the folder
  var sPath = "C:\\FolderName\\SubFolder";
  
  // Obtains the folder's short path
  var sShortPath = aqFileSystem.GetFolderInfo(sPath).ShortPath;
  
  // Posts the folder's short path to the test log
  Log.Message("The folder's short path is: " + sShortPath);
  
}

/*
The routine produces the following output:

The folder's short path is: : C:\FOLDER~1\SUBFOL~1
*/

Python

def ShortPathExample():
  # Specifies the fully qualified name of the folder 
  sPath = "C:\\FolderName\\SubFolder"
  # Obtains the folder's short path 
  sShortPath = aqFileSystem.GetFolderInfo(sPath).ShortPath
  # Posts the folder's short path to the test log 
  Log.Message("The folder's short path is: " + sShortPath)

# The routine produces the following output: 
# The folder's short path is: : C:\FOLDER~1\SUBFOL~1

VBScript

Sub ShortPathExample

  ' Specifies the fully qualified name of the folder
  sPath = "C:\FolderName\SubFolder"
  
  ' Obtains the folder's short path
  sShortPath = aqFileSystem.GetFolderInfo(sPath).ShortPath
  
  ' Posts the folder's short path to the test log
  Log.Message("The folder's short path is: " + sShortPath)
  
End Sub

' The routine produces the following output:
' The folder's short path is: : C:\FOLDER~1\SUBFOL~1

DelphiScript

function ShortPathExample;
var sPath, sShortPath;
begin

  // Specifies the fully qualified name of the folder
  sPath := 'C:\FolderName\SubFolder';
  
  // Obtains the folder's short path
  sShortPath := aqFileSystem.GetFolderInfo(sPath).ShortPath;
  
  // Posts the folder's short path to the test log
  Log.Message('The folder"s short path is: ' + sShortPath);
  
end;

{
The routine produces the following output:

The folder's short path is: : C:\FOLDER~1\SUBFOL~1
}

C++Script, C#Script

function ShortPathExample()
{

  // Specifies the fully qualified name of the folder
  var sPath = "C:\\FolderName\\SubFolder";
  
  // Obtains the folder's short path
  var sShortPath = aqFileSystem["GetFolderInfo"](sPath)["ShortPath"];
  
  // Posts the folder's short path to the test log
  Log["Message"]( "The folder's short path is: " + sShortPath );
  
}

/*
The routine produces the following output:

The folder's short path is: : C:\FOLDER~1\SUBFOL~1
*/

See Also

Working With Files From Scripts
GetFolderInfo Method
Name Property
Path Property
GetShortPathName Method

Highlight search results