Skip to content

Instantly share code, notes, and snippets.

@jan-molak
Forked from DavidEdwards/delete.bat
Created December 7, 2018 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jan-molak/c420d6fd8b0ce56da3f79b70c4eebde0 to your computer and use it in GitHub Desktop.
Save jan-molak/c420d6fd8b0ce56da3f79b70c4eebde0 to your computer and use it in GitHub Desktop.
Delete all files and directory structure at the given path
@echo off
REM Completely delete file / directory
echo Are you sure that you want to delete %1?
echo y/n
choice /c:yn > nul
if errorlevel 2 goto no
if errorlevel 1 goto start
goto end
:start
echo Starting to delete files in %1
del /f/s/q %1 > nul
echo Deleting directory structure at %1
rmdir /s/q %1
goto end
:no
echo Cancelling your request
goto end
:end
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment