> For the complete documentation index, see [llms.txt](https://chaoses-ib.gitbook.io/directory-opus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chaoses-ib.gitbook.io/directory-opus/cao-zuo/yi-dong.md).

# 文件移动

## 命令

移动选中文件到指定文件夹：

```cmd
Copy MOVE TO "C:\目标文件夹"
```

详见 [Copy](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-2/readme.zh/copy.zh.md) 命令。

## 移动到新建文件夹中

输入新建文件夹名，移动选中文件到新建文件夹中：

```cmd
Copy MOVE CREATEFOLDER HERE
```

新建文件夹名不能与选中文件完全同名（包含扩展名）。

移动选中文件到同名文件夹中：

```cmd
Copy MOVE CREATEFOLDER="{file$|noext}" HERE
```

以上命令在多选时，每个文件都会被移入到各自的同名文件夹中。如果想让所有文件都移入第一个文件的同名文件夹中，可以使用以下命令：

```cmd
@set first={file$|noext}
Copy MOVE CREATEFOLDER="{$first}" HERE
```

## 解散文件夹

“解散文件夹”指的是将指定文件夹中的文件全部移动到上一层级，并删除原文件夹。

在 DOpus 中，可以通过以下命令来实现解散文件夹：

```cmd
Copy MOVE FILE="{filepath$}\*" TO="{filepath$|..}"
Delete QUIET FORCE FILE="{filepath$}"
```

通过 `设置 > 文件类型` 打开文件类型编辑器，按下图操作，可以在文件夹的上下文菜单中添加一个“解散文件夹”按钮：

![](/files/B0nrH0dEdDGrd5DXQ06j)

| 操作前                              | 操作后                              |
| -------------------------------- | -------------------------------- |
| ![](/files/nr3MukCZNdSmimAG5Cfq) | ![](/files/3rhLCg9KR33w7rc7H4io) |

如果想要将选中文件夹中的所有子文件夹也一同解散，则可以使用以下命令：

```cmd
@dirsonly
Rename PATTERN="*" TO="{filepath|..}*" AUTORENAME RECURSE
Delete QUIET FORCE
```

或者使用平面视图来手动实现：

1. 右键单击平面视图按钮，选中 `混合`（或左键单击两次平面视图按钮），让所有子文件混合显示

   ![](/files/tkYcHbbUQwBJbknVDztT)
2. 手动将文件移动到上一层级
3. 删除剩余的文件夹

<details>

<summary>上述平面视图操作也可以使用命令来实现</summary>

```cmd
SET flatview=MixedNoFolders
SELECT ALLFILES
COPY MOVE HERE FLATVIEWCOPY=single
SET flatview=off
SELECT ALLDIRS
```

</details>


---

# 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://chaoses-ib.gitbook.io/directory-opus/cao-zuo/yi-dong.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.
