diff --git a/vcbuild.bat b/vcbuild.bat index 4053338df2d6e8..a3335eb96a94c9 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -366,7 +366,8 @@ if errorlevel 1 ( if "%target%" == "Clean" goto exit :after-build -rd %config% +:: Check existence of %config% before removing it. +if exist %config% rd %config% if errorlevel 1 echo "Old build output exists at 'out\%config%'. Please remove." & exit /B :: Use /J because /D (symlink) requires special permissions. if EXIST out\%config% mklink /J %config% out\%config%