I need a script to delete empty subfolders

Posted on 2006-04-15
Last Modified: 2010-04-17
I have a main folder which have many subfolders; some are empty, others are not. I need a script to delete the empty subfolders keeping non-empty subfolders unchanged. Thanks in advance.
Question by:asgarcymed
    LVL 10

    Accepted Solution

    LVL 10

    Expert Comment

    LVL 14

    Expert Comment

    freeware console app (9x/me/NT4/2k/xp) that'll do it..
    RmEmpty  (about 1/2 way down the page)
    from the site's descrption...
    A console mode utility that recursively deletes only empty folders.  Great for clearing out all those junk directories you have laying around.  Will NOT delete files, or folders that have files in them.  Only empty folders (or folders containing nothing but other empty folders) are removed.  [SCRIPT READY]

    Author Comment

    jagadeesh_motamarri - thank you - this is the "magic" bat script :

    for /D /R . %a IN ( * ) DO rmdir /q "%a"

    works perferctly !

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    sum67 challenge 35 76
    no14 challenge 14 46
    zeroFront challenge 7 58
    bigHeights  challenge 13 43
    RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now