aqFileSystem.GetFolderInfo Method

Applies to TestComplete 14.70, last modified on April 22, 2021

Description

The GetFolderInfo method returns an aqFolderInfo object that contains detailed information about the specified folder.

Declaration

aqFileSystem.GetFolderInfo(Path)

Path [in]    Required    String    
Result The aqFolderInfo object.

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

Path

Specifies the path to the desired folder.

The Path parameter may or may not include a trailing backslash (\). You can add a trailing backslash to or remove it from the path by using the IncludeTrailingBackSlash or ExcludeTrailingBackSlash method.

Result Value

An aqFolderInfo object that provides various information about the given folder.

Remarks

If the specified folder does not exist, an error occurs.

Example

The code below obtains information about the specified folder and then moves this folder to another location.

JavaScript, JScript

function GetFolderInfoExample()
{

  // Specifies the path to a folder
  var sPath = "C:\\MyFiles\\MyFolder";

  // Obtains information about the specified folder
  var FoldInfo = aqFileSystem.GetFolderInfo(sPath);
  
  // Specifies a new folder path
  var sNewPath = "C:\\Work\\Test";
  
  // Moves the folder
  FoldInfo.Move(sNewPath);
  
}

Python

def GetFolderInfoExample():
  # Specifies the path to a folder
  sPath = "C:\\MyFiles\\MyFolder"
  # Obtains information about the specified folder
  FoldInfo = aqFileSystem.GetFolderInfo(sPath);
  # Specifies a new folder path
  sNewPath = "C:\\Work\\Test"
  # Move the folder
  FoldInfo.Move(sNewPath)

VBScript

Sub GetFolderInfoExample

  ' Specifies the path to a folder
  sPath = "C:\MyFiles\MyFolder"

  ' Obtains information about the specified folder
  Set FoldInfo = aqFileSystem.GetFolderInfo(sPath)
  
  ' Specifies a new folder path
  sNewPath = "C:\Work\Test"
  
  ' Moves the folder
  FoldInfo.Move(sNewPath)
  
End Sub

DelphiScript

function GetFolderInfoExample;
var sPath, sNewPath;
begin

  // Specifies the path to a folder
  sPath := 'C:\MyFiles\MyFolder';

  // Obtains information about the specified folder
   FoldInfo := aqFileSystem.GetFolderInfo(sPath);
  
  // Specifies a new folder path
   sNewPath := 'C:\Work\Test';
  
  // Moves the folder
  FoldInfo.Move(sNewPath);
  
end;

C++Script, C#Script

function GetFolderInfoExample()
{

  // Specifies the path to a folder
  var sPath = "C:\\MyFiles\\MyFolder";

  // Obtains information about the specified folder
  var FoldInfo = aqFileSystem["GetFolderInfo"]( sPath );
  
  // Specifies a new folder path
  var sNewPath = "C:\\Work\\Test";
  
  // Moves the folder
  FoldInfo["Move"]( sNewPath );
  
}

See Also

Working With Files From Scripts
aqFolderInfo Object

Highlight search results