Skip to content

Instantly share code, notes, and snippets.

@Tyxz

Tyxz/fast_delete.bat

Created Dec 21, 2019
Embed
What would you like to do?
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