I want to delete all bin and obj folders to force all projects to rebuild everything

后端 未结 26 2082
迷失自我
迷失自我 2020-11-28 16:53

I work with multiple projects, and I want to recursively delete all folders with the name \'bin\' or \'obj\' that way I am sure that all projects will rebuild everything (so

26条回答
  •  情深已故
    2020-11-28 17:47

    For the solution in batch. I am using the following command:

    FOR /D /R %%G in (obj,bin) DO @IF EXIST %%G IF %%~aG geq d RMDIR /S /Q "%%G"


    The reason not using DIR /S /AD /B xxx
    1. DIR /S /AD /B obj will return empty list (at least on my Windows10)
    2. DIR /S /AD /B *obj will contain the result which is not expected (tobj folder)

提交回复
热议问题