Last active
May 1, 2023 19:09
-
-
Save leodutra/84fce36e804bb1c50d6f to your computer and use it in GitHub Desktop.
Batch for deleting files and folders recursively on Windows.
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 | |
set foldername=%1 | |
:: Remove files before removing their folders. It's faster | |
DEL /F /Q /S %foldername%\* | |
:: "RD" is much more fast than "RMDIR" | |
for /D %%i in ("%foldername%\*") do RD /S /Q "%%i" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment