> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guides/file-and-folder/copy-file.md).

# Copy file

Copy file is the action of copying a file from one location to another on the computer's hard drive. This action will create a completely new copy at the destination while keeping the original file in its initial location.

#### Configuration parameters:

* Source File: The absolute path of the source file to be copied (For example: `D:\data\template.xlsx`).
* Destination File: The absolute path of the destination file where it will be copied to (For example: `D:\backup\report_2026.xlsx`).

#### Real-world example: Automatically clone a sample Excel file before writing data

When creating a data crawling script or filling out reports, you often have a sample Excel file (`template.xlsx`) that has been pre-formatted with header columns. You do not want the script to overwrite the new data directly, which would ruin this sample file. The solution is that each time the script runs, the system will automatically clone a new file to use:

* Configuration method:
  * Source File: Enter the path of the sample file: `D:\GPM\template.xlsx`
  * Destination File: Enter the path of the new file to be used for writing data: `D:\GPM\data_output.xlsx`
* Result: The system will take the file `template.xlsx`, create an exact copy, and name it `data_output.xlsx` in the specified directory. Subsequent actions of the script (such as *Write excel file*) will only interact with and write data to this `data_output.xlsx` file, keeping your sample file safe and clean for future runs.

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-en/action-guides/file-and-folder/copy-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
