Skip to content

Instantly share code, notes, and snippets.

@Gaspadlo
Last active May 4, 2019 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save Gaspadlo/4c22d07f5ee92a6bd91f379953664aa6 to your computer and use it in GitHub Desktop.
Save Gaspadlo/4c22d07f5ee92a6bd91f379953664aa6 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
cd /d %~dp0
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