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

后端 未结 26 2083
迷失自我
迷失自我 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:43

    You could actually take the PS suggestion a little further and create a vbs file in the project directory like this:

    Option Explicit
    Dim oShell, appCmd
    Set oShell  = CreateObject("WScript.Shell")
    appCmd      = "powershell -noexit Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse -WhatIf }"
    oShell.Run appCmd, 4, false
    

    For safety, I have included -WhatIf parameter, so remove it if you are satisfied with the list on the first run.

提交回复
热议问题