Rename Folder Action Icon

Rename Folder

Declaration

<AMRENAMEFOLDER FOLDER="text" NEWNAME="text" RESULTDATASET="text" />

See Also

Calculate File Checksum | Change Folder | Concatenate Files | Copy File | Create Folder | Delete File | Get File(s) information | Join File | Move File | Read from File | Remove Folder | Rename File | Rename Folder

Description

Renames a directory or folder. This action can optionally move the renamed folder to a new location. If the folder specified contains sub-folders and files, they will also be included during runtime.  

NOTE: Only user-created folders can be renamed. System or special folders cannot be renamed.

Practical Usage

Commonly used to rename and/or move a single directory and all of its subdirectories.

Parameters

General Properties

Property

Type

Required

Default

Markup

Description

Original Folder Name

Text

Yes

(Empty)

  1. FOLDER="c:\sourcefolder\"

  2. FOLDER="c:\sourcefolder\subfolder"

Specifies the path and folder name of the folder(s) to rename.

New Folder Name

Text

Yes

(Empty)

  1. NEWFOLDER="c:\destfolder\"

  2. NEWFOLDER="c:\destfolder\subfolder"

The new destination and/or folder name or the new destination folder and (optionally) Folders specified that do not exist will be automatically created at runtime. Wildcard characters (* or ?) may be used.

Create and Populate Dataset with Result Information

Text

No

(Empty)

RESULTDATASET="DatasetName"

The name of a dataset to be created and populated with status regarding this operation. More information about the fields that this dataset creates are entered below under Notes.

 

Attributes Tab

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab allows you to select/omit specific errors that should cause a particular step to fail.

More on Error Causes properties

On Error Properties

The On Error tab allows you to determine what the task should do if a particular step encounters an error.

More about On Error properties

Notes

Datasets

A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields. The table below describes these fields (assuming the dataset name assigned was theDataset).

Name

Type

Return Value

theDataset.Source

Text

The path and file name of the source file.

theDataset.Destination

Text

The path and file name of the destination file.

theDataset.Result

Number

The result of this operation - 0 for success, or the corresponding error code (number) for failure.

theDataset.Message

Text

The textual information associated to the result.

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Sample 1 - Rename Folder action used to move a folder and its files from one directory to the another. The original folder name is specified.

 

<AMRENAMEFOLDER FOLDER="C:\FolderName" NEWNAME="C:\NewFolderName" RESULTDATASET="FolderRenameDS" />

 

 

Sample 2 - Rename Folder action used to rename a folder to a new name as well as move it to another location.

 

<AMRENAMEFOLDER FOLDER="C:\FolderName" NEWNAME="C:\NewFolderName" RESULTDATASET="FolderRenameDS" />

 

 

↑ Top of Page