Last active
May 4, 2019 21:32
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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