Last active
May 11, 2023 06:46
-
-
Save ciscoheat/d2e2e182122cdf3f0f179625d922c3a7 to your computer and use it in GitHub Desktop.
Batch file version of deleting large directories on Windows: https://stackoverflow.com/a/6208144/70894
This file contains 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 | |
IF "%1" == "" ( | |
echo Usage: rimraf ^[^/f^|-f^|--force^] dir | |
EXIT /B 1 | |
) | |
IF "%1" == "/f" GOTO rimraf | |
IF "%1" == "/F" GOTO rimraf | |
IF "%1" == "-f" GOTO rimraf | |
IF "%1" == "--force" GOTO rimraf | |
echo Deleting %1 | |
pause | |
:rimraf | |
SET remove=%1 | |
IF NOT "%2" == "" SET remove=%2 | |
IF EXIST "%remove%" del /f/s/q "%remove%" > nul | |
IF EXIST "%remove%" rmdir /s/q "%remove%" | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment