开发者

Batch file to delete specific folders

I need a batch file that will recursively remove all directories with a certain fi开发者_开发技巧lename. This is what I have so far and its not working.

FOR /D /r %%G IN ("*.svn") DO DEL %%G


Wow I recently just did something exactly like this:

edit

FOR /F %%C IN ('dir *.svn /s /b') DO DEL %%~C\*.*

FOR /D %%C IN ('dir *.svn /s /b') DO RMDIR %%~C

You probalby need to pass some parameters to del to allow it to delete without asking yes/no

Alternatively just do svn export to checkout code from the repository without those pesky .svn directories.


If you are able to work with Powershell you can use this snippet:

get-childitem . -include .svn -force -recurse | foreach ($_) {remove-item -force $_.fullname}

It's taken from here. Actually if you can use Powershell just forget DOS :)

By the way the dir command has a /s to act recursively (like -r/-R for unix like shells)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜