AI 编程 4.0 · 优秀 2026-10-09 · 文章

Cursor forum: Agent autonomous rd /s /q wiped the entire D: drive (Windows, cmd quote mis-parse)

Cursor 官方论坛帖:autonomous 模式下 Agent 本想删除一个含中文路径的废弃目录,cmd.exe 错误解析转义引号后,rd /s /q 落到 D:\ 根并递归删掉整盘(微信记录多个源码项目应用,无回收站不可恢复)帖中给出可复现命令形态:路径含非 ASCII 字符与嵌套反斜杠时被截断到盘根作者要求对不可逆递归删除设显式确认门与 9 月 ticket T-F90960 及 600 GB 帖同族

打开原文回到归档

Cursor forum: Agent autonomous rd /s /q wiped the entire D: drive (Windows, cmd quote mis-parse)

要点 (中文)

Cursor 官方论坛帖:autonomous 模式下 Agent 本想删除一个含中文路径的废弃目录,cmd.exe 错误解析转义引号后,rd /s /q 落到 D:\ 根并递归删掉整盘(微信记录、多个源码项目、应用,无回收站不可恢复)。帖中给出可复现命令形态:路径含非 ASCII 字符与嵌套反斜杠时被截断到盘根。作者要求对不可逆递归删除设显式确认门。与 9 月 ticket T-F90960 及 600 GB 帖同族。

Key claims (English)

Cursor forum report: in autonomous mode the agent's rd /s /q hit D:\ root after cmd.exe mis-parsed escaped quotes around a non-ASCII path, recursively wiping the whole drive with no Recycle Bin; the author asks for a confirmation gate on irreversible recursive deletes.

Obsidian 证据摘录

Cursor 论坛上,从 2026 年 6 月到 10 月,多起报告是同一族问题:Agent 想删一个子目录,Windows 终端里的 rmdir /s /q 或 rd /s /q 实际打到了盘符根。10 月 9 日又有人写 autonomous 模式下整盘 D: 被清空,会话里 Agent 自己承认命令大约跑了 105 秒。
—— Content/Drafts/2026-10-12-TG正文-Cursor-Windows-rmdir-路径引号打到盘符根.md

原文抓取(opencli web read,节选)

# [Agent] Autonomous `rd /s /q` wiped the entire D: drive (Windows) - Support / Bug Reports - Cursor
> 发布时间: 2026-10-09T07:03:20+00:00
> 原文链接: https://forum.cursor.com/t/agent-autonomous-rd-s-q-wiped-the-entire-d-drive-windows/174156

---

[](https://forum.cursor.com/u/luck_li)

[luck li](https://forum.cursor.com/u/luck_li)

1

[3 天](https://forum.cursor.com/t/agent-autonomous-rd-s-q-wiped-the-entire-d-drive-windows/174156 "发布日期")

### [](#p-509785-where-does-the-bug-appear-featureproduct-1)Where does the bug appear (feature/product)?

Cursor IDE

### [](#p-509785-describe-the-bug-2)Describe the Bug

Cursor Agent, running in autonomous (Agent) mode, executed a Windows `cmd` command intended to delete a single deprecated project directory. Because `cmd.exe` mis-parsed the escaped-quote sequence, the `rd /s /q` command was applied to the **D:\\ drive ROOT** instead of the target subdirectory, recursively deleting the **entire D: drive**.

This permanently destroyed (no Recycle Bin):

-   WeChat chat history database
-   multiple source-code projects
-   installed applications

### [](#p-509785-steps-to-reproduce-3)Steps to Reproduce

1.  Run Cursor Agent on a Windows project located on a non-system drive (e.g. D:).
2.  Ask the Agent to delete a directory whose path contains non-ASCII (Chinese) characters and nested backslashes.
3.  The Agent wraps the path like: cmd /c “rd /s /q "d:<project>\\src\\views...\\vehicleTrack\_GL"”
4.  Windows cmd truncates the path at the escaped quote, so `rd /s /q` runs against D:\\ and recursively deletes the drive.

### [](#p-509785-expected-behavior-4)Expected Behavior

-   Only the intended subdirectory should be deleted.
-   Irreversible, non-Recycle-Bin commands such as `rd /s /q` (recursive delete) should trigger an explicit confirmation gate, or be blocked entirely, before the Agent executes them.

### [](#p-509785-operating-system-5)Operating System

Windows 10/11

### [](#p-509785-version-information-6)Version Information

Cursor IDE, Windows desktop, Agent mode

### [](#p-509785-for-ai-issues-which-model-did-you-use-7)For AI issues: which model did you use?

Agent mode — mixed (gemini-3.8-flash-high, composer-2.5-fast, etc.)

### [](#p-509785-for-ai-issues-add-request-id-with-privacy-disabled-8)For AI issues: add Request ID with privacy disabled

Session a7cf2b75-380b-4262-9485-547cc415dbda / terminal 672262

### [](#p-509785-additional-information-9)Additional Information

The Agent later self-admitted in the session transcript: “Windows cmd does not parse the escaped quote as expected, causing the command to actually recursively scan and delete the D:\\ root directory instead of the target subdirectory. Logs show it ran for ~105 seconds.”

Local evidence available (can provide privately on request):

-   Session transcript ID: a7cf2b75-380b-4262-9485-547cc415dbda
-   Terminal task log: 672262
-   Exact command: cmd /c “rd /s /q "d:...\\vehicleTrack\_GL"”

Happy to share the full logs and transcript privately (via email) — I intentionally did not attach them here because they contain personal account paths.

### [](#p-509785-does-this-stop-you-from-using-cursor-10)Does this stop you from using Cursor

No - Cursor works, but with this issue

35 浏览量

链接