Link to home
Start Free TrialLog in
Avatar of mtchs
mtchs

asked on

Unable to delete a recursive folder

I have 3 folders on our network created that are recursive folders (never ending folder loop)
I have used the "robocopy dummy_file badfile /purge" command but it runs for a couple of minutes and then stops.
This is on a Windows server 2008R2 that is the file server for our students. I know I could reformat the raid but would prefer not too if there is a solution that would allow me to get rid of these files. They are wreaking havoc on our backups and causing the server to lock up.
Avatar of KevinSchmaltz
KevinSchmaltz
Flag of United States of America image

Hey mtchs did you restart the server and go directly to delete those folders it sounds like something is holding them open either an application or a users session.
Avatar of Darrell Porter
Is it truly recursive, or is it simply incredibly deep, exceeding the maximum length?

If the top-level directories are F:\Dir1, F:\Dir2, and F:\Dir3, and they go quite deep, do the following

1. Open an administrative-level CMD.EXE
2. CD down to as far down as you can get in the directory structure before the OS throws an error.
3. At the command prompt, type "SUBST M: ." where M is an available drive letter - SUBST M[colon][space][period] without the quotes.
4. Type M: and press [ENTER]
5. CD down to as far down as you can get in the directory structure before the OS throws an error.
6. Type "SUBST N: ." where N is an available drive letter - SUBST N[colon][space][period] without the quotes.
7. Type N: and press [ENTER]
8. Attempt to do an RD /S /Q DirectoryName at this point.
If not, repeat steps 6 through 8 until you have traversed far enough down in the tree structure to actually begin deleting folders.

If this does not work, let us know.

WT
If it is a locked file, you can use MoveFile.exe from SystemInternals
http://technet.microsoft.com/en-us/sysinternals/bb897556.aspx

It will remove the file upon boot.
ASKER CERTIFIED SOLUTION
Avatar of mtchs
mtchs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial