Sysinternals Homepage
Forum Home Forum Home > Windows Discussions > Troubleshooting
  New Posts New Posts RSS Feed - Very deeply nested directories cannot be deleted
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Very deeply nested directories cannot be deleted

 Post Reply Post Reply Page  <12
Author
Message
drewnoakes View Drop Down
Newbie
Newbie


Joined: 26 August 2008
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote drewnoakes Quote  Post ReplyReply Direct Link To This Post Posted: 05 October 2008 at 10:56pm
Thanks Maxana1.  I see this was your first and only post on these forums.  That's a pretty good strike rate :)

I got into a spot of bother when trying to use robocopy.exe (the replacement for xcopy) to backup my Vista C drive to D before doing a rebuild of my machine due to Vista SP1 completely destroying my machine.  And, because the machine is dead, I'm doing all of this from a Vista recovery mode command prompt.

Anyway, I wanted to copy the entire disk's tree.

Using: robocopy /E /R:0 . D:\

This works faithfully, only by default robocopy follows symbolic links in the NTFS file system.  So, when the link...

c:\users\me\appdata\local\application data

...pointed to...

c:\users\me\appdata\local\

...robocopy recursively expanded this circular reference on the target drive.  Not only did this fill the disk completely, it created thousands of seemingly undeletable folders of the form:

c:\users\me\appdata\local\application data\application data\application data\application data\...

rmdir /Q /S didn't work.  If anyone else hits this problem then the command shell equivalent of Manaxa1's theory works too.  'cd' your way down this series of subdirectories and then use the move command to splice the branch to the root level.   I had to do this twice in order to clear the whole load up, though perhaps I just didn't go deep enough for the first splice.

Regardless, I'm just thrilled to have overcome this problem so that now I can get on with addressing my original problem of repairing a completely useless Vista installation.

Using the 'exclude junctions' (/XJ) option with robocopy sorted this out for me in the end.  I'm sure a few people have been bitten by this.  Junctions to parent folders (as exist in a default Vista install) create circular references that might not play well with other tools, even those included with the OS.

Drew.
Back to Top
CarlHead View Drop Down
Newbie
Newbie


Joined: 08 January 2009
Location: South Africa
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote CarlHead Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2009 at 11:22am
What I did to get around the issue was run a windows backup in the Windows 2003 server, then restore the backup to mapped network drive on our Windows 2008 server.

That way the data is now both accessible and deletable on the new server (which was the goal)
Back to Top
StefanMandl View Drop Down
Newbie
Newbie


Joined: 23 December 2010
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote StefanMandl Quote  Post ReplyReply Direct Link To This Post Posted: 23 December 2010 at 9:44pm
I ran into the same problem when eclipse ran wild and created a very deep folder structure. I could remove the folders by using cygwin and the (dangerous) Unix shell command

rm -rf ....path to offending folder...

Back to Top
 Post Reply Post Reply Page  <12
  Share Topic   

Forum Jump Forum Permissions View Drop Down