Windows batch file to delete .svn files and folders

前端 未结 8 1399
一生所求
一生所求 2021-01-30 09:16

In order to delete all \".svn\" files/folders/subfolders in \"myfolder\" I use this simple line in a batch file:

FOR /R myfolder %%X IN (.svn) DO (RD /S /Q \"%%X         


        
8条回答
  •  面向向阳花
    2021-01-30 10:03

    Bizarre sidenote: if I use

    FOR /R . %%X IN (*.svn) DO (echo "%%X")

    instead of

    
    FOR /R myfolder %%X IN (.svn) DO (RD /S /Q "%%X")

    not only does it list all directories ending in .svn, it lists ALL THEIR CONTENTS as well. This is a BUG in the For command, it gave me an expansion where I gave it no wild card. Very strange.

    Ken

提交回复
热议问题