One-line batch file to delete empty directories

posted on April 22nd, 2008 by conmulligan
for /f "usebackq" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d"

Who knew it was so easy?

From The Old New Thing, by Raymond Chen.

Related Articles

Tags: , ,

One Comment

  • Who said on May 5th, 2008 at 10:25 pm

    - del /s W:// ?
    - WIN+E | find the folder wish to delete then SHIFT+DEL. :D

Leave a Comment