Last active
February 24, 2018 07:34
-
-
Save OiCkilL/c2d5adeecb321357a131374d2d7a1abc to your computer and use it in GitHub Desktop.
DeleteEmptyFolders.bat
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 | |
| set target=%1 | |
| if not defined target ( | |
| goto :usage | |
| ) | |
| for /f "usebackq delims=^" %%j in (`"@dir /ad/b/s %target% | sort /r"`) do ( | |
| rd %%j 2>NUL | |
| ) | |
| echo All empty folders under %target% has been deleted. | |
| goto :EOF | |
| :usage | |
| echo Example: %~n0 [target_folder] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment