Recursively delete all folders starting with

后端 未结 5 650
礼貌的吻别
礼貌的吻别 2021-02-05 20:24

I need to write a command in a .bat file that recursively deletes all the folders starting with a certain string. How may I achieve this ?

5条回答
  •  迷失自我
    2021-02-05 21:29

    This is the complete answer you are looking for:

    FOR /D /R %%X IN (certain_string*) DO RD /S /Q "%%X"
    

    where obviously you need to replace certain_string with the string your folders start with.

    This deletes RECURSIVELY as you asked (I mean it goes throught all folders and subfolders).

提交回复
热议问题