Copy File/Folder

The Copy File/Folder action in Avo Assure, found under the @Generic Element, is used to copy a file or folder to a user-defined location. It also provides options to save the file in a different format or compress a folder to save space. The result of the test step is stored in a dynamic variable.

Syntax

Input Value: <Source_Path>;<Destination_Path>;<1(overwrite)/0(normal)>(Optional);<extension(ex:.csv)>(Optional)

Argument
Description

<Source_path>

(Required)

Specify complete path of the source file or folder to be copy.

<Destination_name> (Required)

The target folder path where the file/folder should be copied.

<1(overwrite)/0 (normal)> (Optional)

  1. Use 1 to overwrite files at the destination if they already exist.

  1. Use 0 to avoid overwriting.

  2. Default behavior is usually 0 (no overwrite).

<extension (ex:.csv)> (Optional)

Filters files by extension; only files with this extension will be copied. Note: Supported file formats are [‘.txt’, ‘.csv’, ‘.xlsx’, ‘.xls’, ‘.doc’, ‘.docx’, ‘.pdf’, ‘.zip’, ‘. unzip’

Output Value:

Argument
Description

<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

This variable stores the status as true or false

Example 1

Copy a file into a specified folder The Copy File/Folder action copies a file or folder from the source path to the destination path (e.g., C:\sam\New folder\Reports.docx;C:\Data folder). This operation helps in organizing or backing up files without altering the original. The action does not overwrite existing files by default. The action status is saved in the {Status} variable with the following possible values:

  • True if the file or folder is copied successfully

  • False – if the copy operation fails due to missing source, access issues, or destination conflicts

Example 2

Copy data from one file format to another

The Copy File/Folder action enables copying content of a specific file format (e.g., .csv) from one location to another with possible format-based filtering (e.g.,C:\Reports\Q1;C:\Reports\Backup;0;.csv). This allows moving only files with the specified extension from the source to the destination, optionally overwriting them. The operation status is captured in the {Status} variable with the following values:

  • True if the file of the specified format are copied successfully

  • False –if the copy fails due to permission issues, format mismatches, or invalid file paths

Last updated

Was this helpful?