windows 7 - Can't delete folder. Infinitely looped folders created within each other

06
2014-04
  • gAMBOOKa

    My flex builder somehow decided to create infinite folders within folders and crashed itself. Now windows cannot delete the folder, saying the file name is too long. Even Unlocker can't delete it.

    The folders are created like this:

    projectname-debug -> projectname-debug -> projectname-debug -> ..........
    
  • Answers
  • egon

    Boot up some linux live distribution and delete it from there.

  • RedFilter

    You might try using the SUBST to map a long path to a new drive letter. That may get the path down short enough for you to delete some of the lower directories first.

  • John T

    Try the command line:

    rmdir /s /q "C:\path\to\folder"
  • developmentalinsanity

    I've had a similar issue due to a screwed up subversion checkout. What I found worked was going in as deep as you can and the move the contents out. You should then be able to delete the outer part. Repeat the process with the stuff you moved out. Worked for me, but it might not be exactly the same situation.


  • Related Question

    How to delete ".."-folder under Windows Vista?
  • acme

    I have a folder on my desktop which is named ".." (which itself contains subfolders with an empty name). The folder can't be deleted the usual ways, even not when using the CLI. Does anyone know how I can remove this folder on Windows Vista 64bit?

    Renaming does not work, too (obviously).

    This is what "dir /x" echoes:

    09.10.2009  15:04    <DIR>                       .
    09.10.2009  15:04    <DIR>                       ..
    08.03.2007  11:18    <DIR>                       cgi-bin
                   0 Datei(en),              0 Bytes
                   3 Verzeichnis(se), 45.866.037.248 Bytes frei
    

  • Related Answers
  • Joshua

    You can use the special \\?\ syntax to try and remove the directory. Try as I might I was unable to create a directory with just .. in it, but was able to create a file with a space before it and .. (so ..) and explorer and normal tools were unable to remove it.

    To use the \\?\ syntax you have to fully qualify the path. e.g.:

    rmdir "\\?\C:\Users\acme\Desktop\.."
    

    Try pressing the tab key to cycle through directory names on your desktop once you get tot the final \ after Desktop. If you do, Windows will start auto-completing the directories that exist under that folder. I suggest this since the actual directory name could be something like .. or .. which would cause the above command to fail with "Cannot find directory".

    EDIT: If it isn't a directory but a file (explorer may show it's a "directory" since .. points to the parent directory) you can use the same \\?\ syntax with the del command.

  • seanyboy

    dir /x will tell you the proper name of the folder.

    09/10/2009  15:05    <DIR>                       ..
    09/10/2009  15:05    <DIR>          5C51~1.-      .. -
    29/09/2009  13:14    <DIR>          BUSINE~1     .businessobjects
    

    Then you just have to delete the folder using that short name.

    rmdir 5C51~1.-
    
  • Arjan

    [A note, given the upvotes: the question is not about the regular Dos or Unix-like "." and ".." for the current and parent directory. It's really about a folder with that name. So, the answer below does not apply. AvB.]

    Correct me if I'm completely misunderstanding the question, but in Windows ".." is the current folder's parent.

    That is, from the command line, doing cd .. while in the Desktop folder, will take you to its parent (C:\Users\username\ on my x64 Win7 machine).

  • quack quixote

    Navigate to your desktop in a command window ("cd C:\Users\YourUserName\Desktop"). Type "DIR /X" -- this will spit out a directory listing.

    There will be two entries at the top named "." and "..". Look for another ".." AFTER that, in the right-most column. Does it have another name in the next column? That's the short filename. Type "rmdir /s [short-filename]". Reread what you typed. Reread again -- make absolutely sure you typed it right before you hit enter.

    Do NOT run "rmdir /s .." -- bad things will happen.

  • Vili

    Did you try chkdsk or similar? (Don't know if there is chkdsk on vista.)

  • Paul

    Suggestion (1) Login as a different user, move all your valid files out of Desktop directory, then delete/recreate it.

    Suggestion (2) Win32 unix tools usually work a bit better than the cmd equivalents, so I would give them a go. At the very least they're worth installing:

    http://unxutils.sourceforge.net/

  • harrymc

    As I never saw a directory with that name, I can only suggest to try using old DOS.
    Use in the Command Prompt, or cmd.exe, the dir command with the -x parameter.
    If the file is displayed with any other name than "..", use the del command:

    del file~1.MOV

    If this doesn't work, try:

    del ".."

    Otherwise, move everything else out of the directory and use implicit del:

    Del *.*

    then return the moved files back.

  • Bob

    I think Unlocker can help you. It is a very simple tool and works with vista x64.

  • invert

    To the poster above who said to enter "del ..", do not do this. It will prompt you 'Are you sure (Y/N)?' and answering Y will delete all files in the directory BELOW. Sorry for posting in the answer box, but I only joined yest and can't post comments yet.

    Try boot a Linux Live CD and remove the '..' directory through there.

  • Tom Wijsman

    Boot with a Linux live cd and make sure you have access to the hard drive, ... then in terminal run:

    sudo rm -R /path/to/file/or/folder/named/..