> 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/folder-get-file-list.md).

# Folder get file list

Folder get file list 是用于扫描计算机上某个文件夹的操作，它会收集该文件夹内所有文件的路径，然后将全部结果保存到输出变量的一个数组（array）列表中。

当您有一个包含大量图片、视频或配置文件的文件夹，并希望获取该列表以便使用循环逐个处理每个文件，或者用来统计该文件夹中总共有多少个文件时，此操作会非常有用。

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

> 🔗 有关如何结合此操作来统计文件数量并进行条件检查的详细说明，请参阅 Count 部分中的[2. 统计文件夹（Folder）中的文件数量](/automate-zh/action-shi-yong-zhi-nan/variables/count.md#vi-du-thuc-te-dem-so-luong-anh-bat-dong-san-trong-thu-muc-d-bds-cat-bi)一节。


---

# 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/folder-get-file-list.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.
