> 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-zh/action-shi-yong-zhi-nan/file-and-folder/delete-file.md).

# Delete file

Delete file 是用于根据指定路径将文件从计算机硬盘中完全删除的动作。

🎥 查看更多指导视频：[点击这里](https://youtu.be/EH7olDLAb9c)。

> ⚠️ 重要提示：通过此动作删除的文件将永久消失，不会保存在 Windows 的回收站（Recycle Bin）中。因此，在执行操作之前，您需要确认路径正确，以避免误删重要数据。

#### 配置参数：

* File Path：需要删除的文件在计算机上的绝对路径（例如：`D:\data\temp_cookie.txt`）。

#### 实际示例：脚本结束后自动清理临时文件

当运行诸如从网络下载视频以重新上传到其他频道，或将临时数据导出为文本文件以处理字符串等脚本时。在完成工作后（视频已上传完成、数据已同步到 Google Sheet），您需要删除这些中间文件，以避免占满计算机内存。

* 配置方式：
  * 在脚本末尾，调用 Delete file 动作。
  * File Path：填写已使用的临时文件路径，例如：`D:\render\temp_video.mp4`。
* 结果：系统将彻底删除 D 盘目录下的 `temp_video.mp4` 文件。您的工作目录将始终保持整洁，计算机也不会在自动化流程长期运行数天后出现硬盘空间被占满的情况。

<figure><img src="/files/W5f0QNFultVOLCxGUESh" 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-zh/action-shi-yong-zhi-nan/file-and-folder/delete-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.
