在Windows中递归删除具有指定名称的文件夹的命令行工具? [英] Command line tool to delete folder with a specified name recursively in Windows?

查看:453
本文介绍了在Windows中递归删除具有指定名称的文件夹的命令行工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要删除每个文件夹和子文件夹中的每个"_svn" ...

I want to delete every "_svn" in every folder and subfolder...

例如


c:\
  proyect1
   _svn
   images
     _svn
     banner
       _svn
     buttons
       _svn

然后我运行类似

rm-recurse c:\proyect1 _svn

我应该得到:


c:\
  proyect1
   images
     banner
     buttons

理想的情况是使用小型独立EXE或类似的文件.

The ideal thing would be a tiny stand-alone EXE or something like that.

- 感谢Grant,在我发布问题后,我看到了关于SVN的 SVN 文档导出命令,但我也想删除Visual Studio创建的_vti_ *文件夹,因此我还将探讨for解决方案.

-- Thanks Grant, as soon as I posted the question I saw SVN documentation about the SVN export command, but I also want to delete the _vti_* folders stuff Visual Studio creates, so I'll also explore the for solution.

推荐答案

类似于BlackTigerX的"for",我打算提出

Similar to BlackTigerX's "for", I was going to suggest

for /d /r . %d in (_svn) do @if exist "%d" rd /s/q "%d"

这篇关于在Windows中递归删除具有指定名称的文件夹的命令行工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆