Deleting empty folders (recursive)

Discussion in 'Computer Support' started by =?ISO-8859-1?Q?Brian_H=B9=A9?=, Nov 19, 2006.

  1. Can anyone tell me what commands I need to enter at a DOS/Command prompt
    so as to be able to delete EMPTY folders recursively please?
    Thanks
    Brian
     
    =?ISO-8859-1?Q?Brian_H=B9=A9?=, Nov 19, 2006
    #1
    1. Advertisements

  2. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    beenthere Guest

    If they are one inside another, use the deltree cmd on the top one.
    HTH.
     
    beenthere, Nov 19, 2006
    #2
    1. Advertisements

  3. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    Bert Hyman Guest

    In "beenthere"

    If I remember my history, DELTREE will delete the contents of the
    directories as it goes; the OP only wants to act on EMPTY folders.

    DELTREEE isn't included in XP; the equivalent is RMDIR.
     
    Bert Hyman, Nov 19, 2006
    #3
  4. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    Evan Platt Guest

    Evan Platt, Nov 20, 2006
    #4
  5. That's why I capitalized EMPTY ;-)
    Couldn't find anything that gave command line options, which is what I
    really need, but did find a program to do it.
    Thanks
     
    =?ISO-8859-1?Q?Brian_H=B9=A9?=, Nov 20, 2006
    #5
  6. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    Evan Platt Guest

    So you didn't see the first link,
    http://www.findarticles.com/p/articles/mi_zdpcm/is_200302/ai_ziff35243

    "You don't need a program; you can do this at the command prompt.
    "....
     
    Evan Platt, Nov 20, 2006
    #6
  7. =?ISO-8859-1?Q?Brian_H=B9=A9?=, Nov 20, 2006
    #7
  8. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    ProfGene Guest

    To delete anything in DOS you give the command del and then the path to
    what it is you are deleting. such as del C:\temp You will then get a
    prompt are you sure y/n and you type in y.
     
    ProfGene, Nov 20, 2006
    #8
  9. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    Pennywise Guest

    RMDIR <folder> /S
     
    Pennywise, Nov 20, 2006
    #9
  10. I see you didn't understand any of the question.
     
    =?ISO-8859-1?Q?Brian_H=B9=A9?=, Nov 21, 2006
    #10
  11. I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
    I want to delete EMPTY folders
     
    =?ISO-8859-1?Q?Brian_H=B9=A9?=, Nov 21, 2006
    #11
  12. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    Pennywise Guest

    I tested this before I posted, all were empty recursive directories.
    C:\temp/1/2/3/4/5/6/7
    RMDIR 1 /S did the trick.
     
    Pennywise, Nov 21, 2006
    #12
  13. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    Bert Hyman Guest

    In
    He wants to delete ONLY empty folders.
     
    Bert Hyman, Nov 21, 2006
    #13
  14. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    beenthere Guest

    Hi B. must ask why you have to do this in DOS.
    In Windows, you`d just Search for Empty.
    When you`ve got them all, highlight them, rt\click, and
    delete.
    bw..OJ
     
    beenthere, Nov 21, 2006
    #14
  15. I can do it with PERL to recurse all folders and delete files of zero
    length, but I can't work out the code in PERL to delete empty folders.
    I've already asked for help with PERL with another problem I have, but
    help just doesn't seem to be forthcoming as it appears that people think
    I'm a kid trying to get them to do my homework for me.
     
    =?ISO-8859-1?Q?Brian_H=B9=A9?=, Nov 21, 2006
    #15
  16. I just built the same structure, placed a txt file in folder 3, went
    into temp typed rmdir 1 /s and it deleted all the folders including
    the txt file.

    So my question stands, how do I delete EMPTY folders?
     
    =?ISO-8859-1?Q?Brian_H=B9=A9?=, Nov 21, 2006
    #16
  17. I want to create a batch file with the command so that I can use it as a
    right click menu item, I just want to be able to go to a folder, right
    click, and have it scan and delete all empty subfolders.
     
    =?ISO-8859-1?Q?Brian_H=B9=A9?=, Nov 21, 2006
    #17
  18. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    Pennywise Guest

    See it works :)
    Try RmEmpty in your batch file http://www.otbsw.com/
    http://www.otbsw.com/Files/rmemp12.zip
     
    Pennywise, Nov 21, 2006
    #18
  19. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    Pennywise Guest

    Pennywise, Nov 22, 2006
    #19
  20. =?ISO-8859-1?Q?Brian_H=B9=A9?=

    Plato Guest

    Depends on the OS you are using.
     
    Plato, Nov 23, 2006
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.