Batch command to delete all subfolders with a specific name

前端 未结 3 1225
一个人的身影
一个人的身影 2021-01-30 09:00

I have a directory as such:

D:\\Movies
D:\\Movies\\MovieTitle1\\backdrops\\
D:\\Movies\\MovieTitle2\\backdrops\\
D:\\Movies\\MovieTitle3\\backdrops\\
D:\\Movies\         


        
3条回答
  •  抹茶落季
    2021-01-30 09:14

    Above answer didn't quite work for me. I had to use a combination of @itd solution and @Groo comment. Kudos to them.

    Final solution for me was (using the backdrop folder example):

    FOR /d /r . %%d IN ("backdrops") DO @IF EXIST "%%d" rd /s /q "%%d"
    

提交回复
热议问题