Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Batch for deleting files and folders recursively on Windows.
@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