Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定目录结构 c:\a\b\c\d\ - 什么 DOS 命令将删除 c:\a 中包含的所有文件以及子目录 b、c 和 d 中的所有文件?我们不想删除任何目录 - 只是文件。
利用:
del *.* /s /q
检查目录是否仍然存在:
tree
该DEL命令仅删除文件,而不是目录,因此以下命令将按照您的要求执行:
DEL
DEL /S C:\a
您需要用于RMDIR删除目录。
RMDIR
@del /S /Q /F a\* >nul @for /d %%i in (a\*) do @rmdir /s /q "%%i"