Skip to content

Instantly share code, notes, and snippets.

@warthurton
Forked from Gaspadlo/stuff_to_del.bat
Created May 30, 2017 18:20
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 warthurton/a7572e89b253289408a2c3a3424f5d17 to your computer and use it in GitHub Desktop.
Save warthurton/a7572e89b253289408a2c3a3424f5d17 to your computer and use it in GitHub Desktop.
Fastest possible way to delete large number of files/folders for MS Win (thousands to millions of folders)
@echo off
set /p Input=Enter Folder name to delete:
:ConfPromt
set /p Confirm=Are you sure you want to delete "%CD%\%Input%"?(y/n):
IF /I "%Confirm%" == "n" (
Echo Canceling.
pause
EXIT /b
)
IF /I NOT "%Confirm%" == "y" (
GOTO ConfPromt
)
Echo Delete Start
set "startTime=%time%"
del /f/s/q "%Input%" > nul
rmdir /s/q "%Input%"
Echo "Deleted %CD%\%Input% in [%startTime% > %time%]"
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment