> 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-guide/file-and-folder/copy-file.md).

# Copy file

Copy file is an action used to copy a file from one location to another on the computer's hard drive. This action will create an entirely new copy at the destination while keeping the original file intact at its initial location.

🎥 Watch the tutorial video: [Here](https://youtu.be/EH7olDLAb9c).

#### Configuration parameters:

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

#### Real-world example: Automatically duplicate the sample Excel file before writing data

When creating a data scraping script or filling out reports, you often have a sample Excel file (`template.xlsx`) that has pre-formatted 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 duplicate a new file for use:

* Configuration:
  * 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="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-b22735315cad6e6187c7fda1ce407cbeb40db920%2Fff-02.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
