Skip to content

Instantly share code, notes, and snippets.

@DavidEdwards
Created December 1, 2017 11:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DavidEdwards/61d4d336232284b33b237b04da5bfe10 to your computer and use it in GitHub Desktop.
Save DavidEdwards/61d4d336232284b33b237b04da5bfe10 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