> 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/cao-zuo-zhi-nan/file-and-folder/create-folder.md).

# 创建文件夹

创建文件夹是指在指定路径上完全初始化一个新的文件夹（folder）的操作。

该操作具有智能和安全的运行机制：

* 如果文件夹不存在：系统将自动创建该文件夹（包括自动创建父文件夹，如果它们尚不存在）。
* 如果文件夹已存在：系统将忽略并继续执行后续操作，绝对不会覆盖或影响旧文件夹中的数据。

#### 配置参数：

* 文件夹路径：指向您想要初始化的文件夹的绝对路径（例如：`D:\GPM_Softwares\Data_Crawler`）。

#### 实际示例：根据日期自动创建屏幕截图（Screenshot）文件夹

在运行账户养护或数据抓取脚本时，您通常需要在遇到错误时截取浏览器的屏幕，以便于检查。为了便于管理，您希望系统每天将图片自动整理到一个独立的文件夹中，格式为日期（例如：`D:\GPM_Screenshots\2026-06-29`）。

* 配置方法：
  * 在调用截屏命令之前，您调用创建文件夹操作。
  * 文件夹路径：您将固定路径与系统时间变量结合，填写为：`D:\GPM_Screenshots\$currentDate`。
* 结果：当脚本运行到这一步时，系统将自动检查今天是否已存在名为当前日期的文件夹（例如：`2026-06-29`）。如果没有，它将自动创建一个干净的新文件夹。后续的截屏操作只需将图片保存路径指向该文件夹即可，确保您的数据始终按天分类整齐。


---

# 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/cao-zuo-zhi-nan/file-and-folder/create-folder.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.
