批处理脚本 - 使用模式清空路径中的多个目录
我正在编写一个简短的批处理脚本,它将删除一组目录中的所有文件。更具体地说,假设我有顶级目录“workspace”,它包含几个以“project”开头的目录(例如project-something、project-another)。然后,每个“项目”目录都包含一个“模型”目录。我想让脚本清空每个模型目录。
我知道这是行不通的,但我正在寻找类似的内容
del project*\model\*
,但我知道项目后的 * 不会选择以项目开头的所有目录,然后进入模型目录来清除它们。这样做的正确方法是什么?
谢谢您的宝贵时间!
I'm looking to write a short batch script that will delete all files within a set of directories. More specifically, suppose I have the top directory "workspace" and it contains several directories beginning with the sting "project" (e.g. project-something, project-another). Then each of these "project" directories contain a "model" directory. I want to have the script empty each of these model directories.
I know this is doesn't work, but I looking for something along the lines of
del project*\model\*
But I know that the * after project will not select all directories starting with project then proceed into the model directories to clear them. What would be a correct way to go about doing this?
Thank you for your time!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将其放入 .bat 文件并运行。
Put this into a .bat file and run.