> 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/delete-file.md).

# Delete file

Delete file according to the File Path.

Delete file is an action used to completely remove a file from the computer's hard drive according to the specified path.

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

> ⚠️ Important note: The file deleted by this action will disappear permanently and will not be in the Recycle Bin of Windows. Therefore, you need to be sure about the path before executing to avoid accidentally deleting important data.

#### Configuration parameters:

* File Path: The absolute path to the file that needs to be deleted on the computer (For example: `D:\data\temp_cookie.txt`).

#### Practical example: Automatically clean up temporary files after the script ends

When running scripts such as downloading videos from the internet to re-upload to another channel, or exporting temporary data to a text file for string processing. After completing the task (the video has been uploaded, the data has been synchronized to Google Sheet), you need to delete these intermediate files to avoid filling up the computer's memory.

* Configuration steps:
  * At the end of the script, you call the Delete file action.
  * File Path: Enter the path of the temporary file used, for example: `D:\render\temp_video.mp4`.
* Result: The system will completely delete the file `temp_video.mp4` in the D drive. Your working directory will always be tidy, and the computer will not experience hard drive overflow after many days of running automated threads.

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-5c915310157392c3879e083c5700350ee1a7478b%2Fff-04.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/delete-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.
