We help IT Professionals succeed at work.
Get Started

Created very long folder path - cannot delete (PLEASE read first)

dgrrr asked
Last Modified: 2012-05-09

I have read many posts here and elsewhere about related problems, and I have tried some of the solutions, but before I continue, I wanted to post so that I know I"m not wasing my time with unrelated fixes.

IN XP Home, I used cobian backup program to accidentally save "K:\*.*" to "K:\backup - live files\K drive\K\"
(that was a mistake, obviously I meant it to go onto another drive)
It was running all night, so it may have created a VERY LONG CHAIN.

It created a very long chain of subfolders - it let me browse to this point:
K:\backup - live files\K drive\K\backup - live files\K drive\K\backup - live files\K drive\K\backup - live files\K drive\K\backup - live files\K drive\K\backup - live files\K drive\K\backup - live files\K drive\K\backup - live files\K drive\K\backup - live

I renamed (shortened) as many folders as I could access, so now the path is:
K:\xdel\x\x\x\x\K\x\x\x\x\x\x\x\x\x\x\x\x\s\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\K\x\x\x\x\x\K\x\x\K\x\x\x\x\x\K\x\x\x\x\x\x\x\x\x\x\x\x\x\x\K\x\x\x\x\x\x\x\x\x\x\x\x\x\x\K\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\x\backup - live files\

I cannot enter, rename or move the last folder in the chain that I can access.

When I try to delete the folder it says:
Confirim file delete - the folder xdel contains items whose name is too long for the recycle bin. Permanently delete?
I say yes, then it says:
Error deleting file or folder - Cannot delete BACKUP~1: the file name you specified is not valid or too long.

I ran chkdsk /f /r for this but this did not help.

I tried RD /S (aka rmdir /s) but it said "Maximum path length exceeded". (thanks very much)

I tried the fix that uses a script and robocopy:
but that didn't work - the cmd box loaded about 10 screens of pathh names and then froze (with robocopy at 100% cpu usage)
NOTE - the path may be VERY VERY VERY LONG!

Some ppl say try xcopy too but I dno't see a delete switch. And if robocopy fails, I doubt xcopy would fail.

I tried the java app here:
but that didn't work

And I saw:
I don't want to pay for something if I don't know if it will work.

NOTE - I have seen these two fixes:
~ share the folder, then map a drive and delete from the mapped drive
~use the subst command to create a virtual drive and delete from Windows explorer all folders underneath

But so many ppl report that this does NOT WORK that I wanted to check here first.

Watch Question
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE