May 6, 2008
2:09 am | Last updated: March 2, 2009 at: 2:35 am

Raymond Chen, the Microsoft coder, explains that you don't need a whole 260KB program to automatically delete empty subdirectories. You can create a single line batch file that will do exactly what you're looking for:

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

Contextual Related Posts:

1 Response | RSS comments on this post | Leave a comment»

  1. 1
    ST says#1 | October 28th, 2009 at 9:19 pm

    This works great as long as there are no spaces in the path...try this instead:

    @echo off
    for /f "delims=" %%i in ('dir "%~f1" /ad /b /s ^| sort /R') do rd "%%i" 1>NUL 2>&1

No Pingback yet

PingBack URI

Leave a Response

Comment Preview
« Custom Search Engine (CSE) integrated into AdSense for searchVMware Fusion 2.0 Build 89933 Beta »
Feed Icon

Subscribe via RSS or email: