Deleting nested folders and file within the folders

Discussion in 'Windows Server' started by Jacob Hahn, May 25, 2007.

  1. Jacob Hahn

    Jacob Hahn Guest

    I have a problem where over 355 nested folders were created in a directory
    and I cannot delete the folders. I get the following error, “the filename you
    specified is too longâ€. I am running Widows 2003 Enterprise on a active
    passive cluster with service pack 2 and the system is patched with all
    operating system patches. I have tried to use a command prompt to CD into the
    lowest level and try deleting from there and that does not work, you can only
    go about 14 deep then it errors.
    Thanks for any help in advanced.
    Jacob
     
    Jacob Hahn, May 25, 2007
    #1
    1. Advertisements

  2. Jacob Hahn

    Herb Martin Guest

    You don't say HOW you are trying to delete it so try this from a command
    prompt:

    cd /s /q \path_to_top_directory_to_delete

    (The above is very dangerous if you point it to the wrong place.)

    The OLD "linkd.exe" used to be really great at deleting problem directories
    because it just violently deleted them when you linked the problem directory
    to another location.

    Unfortunately they 'fixed it' to give a warning instead when the directory
    already exists. It was very dangerous before, and I sort of agree with that
    philosophe (do not harm) but it was nice that linkd could be (ab)used to
    kill almost any directory.
     
    Herb Martin, May 25, 2007
    #2
    1. Advertisements

  3. Jacob Hahn

    Jeremy Guest

    As and alternate to Herb's suggestion to delete the whole structure (which
    is the best way to go if that is what you want to do), you could try using
    the 8.3 name for the path to delete:

    So the path C:\longfolder\longlonglongfolder\superlongfoldername would be:
    C:\LONGFO~1\LONGLO~1\SUPER~1

    This might get you past it.

    If that doesn't work you could try sharing the folder that is immediately
    above the too-long path, then map a drive to that and delete away.

    Cheers,
    Jeremy.
     
    Jeremy, May 27, 2007
    #3
  4. Jacob Hahn

    Herb Martin Guest

    And alternative to the sharing is to LinkD (.exe from the MS Reskit
    tools online for download) into that path, somewhere past the problem
    directory as Jeremy suggests....

    linkd c:\t c:\longdir\etc\ugh\etc\
     
    Herb Martin, May 27, 2007
    #4

  5. stupid question here.. have you tried "rd /s /q"? I'm coming in late
    to the conversation and don't know what was already discussed.

    Mike
     
    Special Access, May 27, 2007
    #5
  6. Jacob Hahn

    Herb Martin Guest

    It's a pretty good idea -- it was one of mine but you can't know that
    if you didn't see the start of the thread. <grin>
     
    Herb Martin, May 27, 2007
    #6
  7. On Sun, 27 May 2007 13:36:07 -0500, "Herb Martin"

    figures hehehe Once again, a day late and a dollar short!
     
    Special Access, May 28, 2007
    #7
  8. On Sun, 27 May 2007 13:36:07 -0500, "Herb Martin"

    What about using SUBST to get lower in the directory chain and delete
    from there?

    Mike
     
    Special Access, May 28, 2007
    #8
  9. Jacob Hahn

    Jacob Hahn Guest

    Thank you for the responce, the directory name it too short.
    Directory of S:\K\kwjohnson\cs160\inlab4\inlab5

    06/01/2007 03:58 PM <DIR> .
    06/01/2007 03:58 PM <DIR> ..
    06/01/2007 03:58 PM <DIR> inlab5
    03/05/2007 04:42 PM 483 README.TXT
    04/04/2007 01:26 PM 2,556 STRING~1.CLA StringParser.class
    04/04/2007 01:26 PM 172 STRING~1.CTX StringParser.ctxt
    04/04/2007 01:26 PM 2,602 STRING~1.JAV StringParser.java
    4 File(s) 5,813 bytes
    3 Dir(s) 1,040,571,613,184 bytes free

    I want to delete the inlab5 and below.
     
    Jacob Hahn, Jun 4, 2007
    #9
  10. Jacob Hahn

    Jacob Hahn Guest

    I did try that.

    S:\K\kwjohnson\cs160\inlab4\inlab5>rd /s /q inlab5
    inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab
    5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5\inlab5 - The directory is not empty.

    Thank you for the post.
    Jacob
     
    Jacob Hahn, Jun 4, 2007
    #10
  11. Jacob Hahn

    Jacob Hahn Guest

    I did not work,

    Thanks for the post


     
    Jacob Hahn, Jun 4, 2007
    #11
  12. Jacob Hahn

    Jacob Hahn Guest

    Here is some more informtion, in the past I was able to mount the file share
    with smbclient on a Linux box and delete the files that way, this time it
    does not work.
    ----------------------------------------
    [[email protected] inlab5]# pwd
    /mnt/opal-s/K/kwjohnson/cs160/inlab4/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5
    [[email protected] inlab5]# rm -rf inlab5/
    rm: cannot lstat `.' in
    `inlab5//inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5/inlab5': Input/output error
    -------------------------------------------------------
     
    Jacob Hahn, Jun 4, 2007
    #12
  13. Jacob Hahn

    Jacob Hahn Guest

    That did not do the trick.

    S:\K\kwjohnson\cs160\inlab4\inlab5>linkd inlab5 /d
    The delete operation failed.
     
    Jacob Hahn, Jun 4, 2007
    #13
  14. Jacob Hahn

    Herb Martin Guest

    The idea was to get a SHORT path above the actual directory
    to be deleted:

    Linkd only works for local drives however -- not network volumes.
     
    Herb Martin, Jun 4, 2007
    #14
    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.