Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Windows 7 Professional 64-bit, and I somehow managed to create a system of recursive directories. For example, I have directories A, B, and C, which are nested like so: A/B/C. However, when I open directory C, I see directory A. The final directory structure looks something like A/B/C/A/B/C/... If I try deleting this with Windows (both using and bypassing the Recycle Bin) I get an error stating that "The source file name(s) are longer than the system supports." Using RMDIR /s does not work either, as it complains that the folders are not empty (even with the /s parameter specified). How can I delete these directories permanently?

share|improve this question
Have you tried booting from a live Linux and trying to delete the first folder? – who.knows Jul 16 '13 at 14:09
Shift + Del work? – zekk Jul 16 '13 at 14:20
Shift+Del doesn't work, and I'm at a camp right now and don't have access to disks to burn Linux ISOs to. – NickMoose Jul 16 '13 at 14:24
up vote 5 down vote accepted

Give these a shot. Good luck!

Use some Robocopy tricks, quote:

  1. Create a dummy folder on the drive (D: in this example) where the elongated path lives:

    md AnyFolderName

  2. Copy the dummy folder to the mutant folder using the /MIR (mirror) command line switch:

    robocopy D:\AnyFolder D:\BackupFolder /MIR

  3. Let RoboCopy clean up the fouled folder. This could take a few minutes depending on the size of the folder.

  4. Remove the fixed folder and the dummy folder:

    rd /s D:\BackupFolder rd /s D:\AnyFolder

That’s it. You are good to go.



I had one folder with multiple folders inside like that, and the way i used is to rename the folder (main folder first then the next ones) and i finally was able to delete the main folder without any tools...



I found out make a drive mapping about halfway into the folder structure you should be able to delete the latter half of the file heirarcy.

For example if you are getting the error trying to delete:


Then map a network drive Z: to


This will reduce the file herarch down to a smaller path. Open explorer and view the Z: drive. It should contain a folder called L (in this example).

You should now be able to delete the L and its subfolders without an issue, thereby deleting half the folder hierarchy. After that, disconnect the z: drive and try to delete whatever is left normally. Problem solved!


Use the Unlocker utility.

[4]: preformatted text here

share|improve this answer
Thanks! The robocopy option worked, though it crashed before it claimed it finished. – NickMoose Jul 17 '13 at 1:40

Try something like rd /s \\?\C:\A.

share|improve this answer

Delete the reparse point(s) that creates the loop. Find it with (may have to CTRL-C if keeps going into deeper looped directories):

dir /A:L /S C:\A\

Then delete it with RMDIR which will unlink it but not delete the contents.

rmdir C:\A\B\C\A\

Repeat until there are no more reparse points then delete the directory normally.

share|improve this answer

Instead of copying it over to the Directory just use Robocopy to delete immediately...
Create your Empty folder then use the syntax robocopy c:\emptyfolder c:\folderthatwillnotdelete /purge

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .