Posted By

meetneps on 11/06/08


Tagged

command Shell windows files batch dos


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

localhorst
luciacalvom
hERB
Tyster
Priestd09


Batch Script to Delete all the empty folders in windows


 / Published in: DOS Batch
 

URL: http://neps.in/2008/02/01/cleaningup-empty-folders-in-windows/

  1. REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. REM
  3. REM FILENAME : GETDIRS.BAT
  4. REM
  5. REM DESCRIPTION : GENERATE LIST OF FOLDERS RECURSIVELY IN A FILE "TOEMPTY.BAT"
  6. REM
  7. REM AUTHOR : Napoleon Arouldass S. http://neps.in
  8. REM
  9. REM DATE WRITTEN : Tuesday, August 21, 2007 10:37:25 PM
  10. REM
  11. REM COMMENTS/REMARKS : This is the first step
  12. REM
  13. REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  14. REM GET DIRECTORY LISTING OF WINDOWS FILE SYSTEM
  15. DIR %1/AD/B/S | SORT /R > TOEMPTY.BAT
  16. REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Scooter on November 6, 2008

for /f "usebackq" %%d in ("dir /ad/b/s | sort /R") do rd "%%d"

Posted By: Scooter on November 6, 2008

for /f "delims=" %%i in ('dir /s /b /ad ^| sort /r') do rd "%%i">NUL

You need to login to post a comment.