# 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.&#x20;

### **Syntax**&#x20;

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

| Argument                                       | Description                                                                                                                                                                                                          |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<Source\_path></p><p>(Required)</p>        | Specify complete path of the source file or folder to be copy.                                                                                                                                                       |
| <p>\<Destination\_name><br>(Required)</p>      | The target folder path where the file/folder should be copied.                                                                                                                                                       |
| <p><1(overwrite)/0 (normal)><br>(Optional)</p> | <ol><li>Use 1 to overwrite files at the destination if they already exist.</li><li>Use 0 to avoid overwriting.</li><li>Default behavior is usually 0 (no overwrite).</li></ol>                                       |
| <p>\<extension (ex:.csv)><br>(Optional)</p>    | <p>Filters files by extension; only files with this extension will be copied.<br><strong>Note:</strong> Supported file formats are \[‘.txt’, ‘.csv’, ‘.xlsx’, ‘.xls’, ‘.doc’, ‘.docx’, ‘.pdf’, ‘.zip’, ‘. unzip’</p> |

**Output Value:**&#x20;

| 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

<figure><img src="/files/PgbqZihJLF5PQ1msc1cy" alt=""><figcaption></figcaption></figure>

**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

<figure><img src="/files/4DuW4uV9X2svB3r4XwYG" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/file-and-folder-operations/copy-file-folder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
