繁体   English   中英

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

[英]How to delete a folder and all contents using a bat file in windows?

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

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

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

有人可以帮忙吗?

@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
  1. del /s /qc:\\where ever the file is\\*
  2. rmdir /s /qc:\\where ever the file is\\
  3. mkdir c:\\where ever the file is\\

del / s / qc:\\其中文件是*

这将删除文件夹和子文件夹中的所有文件,但会保留空子文件夹

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM