Skip to content

Instantly share code, notes, and snippets.

@Tyxz
Created December 21, 2019 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Tyxz/e4d95239284c0ef6549ba42cebc60c04 to your computer and use it in GitHub Desktop.
Save Tyxz/e4d95239284c0ef6549ba42cebc60c04 to your computer and use it in GitHub Desktop.
Windows bat-script to fast delete a folder and all sub-directories with a cmd command.
@ECHO OFF
CLS
ECHO ######################################
ECHO # Fast delete folder and sub-folders #
ECHO ######################################
ECHO.
ECHO.
set /P c=Delete %CD% [Y/N]?
if /I "%c%" EQU "Y" goto :DELETE
if /I "%c%" EQU "J" goto :DELETE
EXIT
:DELETE
ECHO ########################################################
ECHO Start deleting... don't close this window until finished
SET DIR=%CD%
CD /
DEL /F/Q/S "%DIR%" > NUL
RMDIR /Q/S "%DIR%"
ECHO Finished deleting %DIR%.
ECHO Hope you were sure what you did there...
ECHO ########################################################
PAUSE
EXIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment