@echo off cd /d "%~dp0.." if not exist dist (echo dist not found & exit /b 0) echo Deleting dist... rmdir /s /q dist if exist dist (echo Failed. Close Explorer and any app using dist, then run this again.) else (echo dist deleted.) pause