小编典典

如何在 Windows 中使用 bat 文件删除文件夹和所有内容?

all

我想使用 bat 文件删除包含所有文件和子文件夹的文件夹。

我尝试了以下方法,但它不起作用:

@DEL D:\PHP_Projects\testproject\Release\testfolder*.*

有人可以帮忙吗?


阅读 303

收藏
2022-08-08

共1个答案

小编典典

@RD /S /Q "D:\PHP_Projects\testproject\Release\testfolder"

说明

移除(删除)一个目录。

RMDIR [/S] [/Q] [drive:]path RD [/S] [/Q] [drive:]path

/S      Removes all directories and files in the specified directory
        in addition to the directory itself.  Used to remove a directory
        tree.

/Q      Quiet mode, do not ask if ok to remove a directory tree with /S
2022-08-08