Link to home
Start Free TrialLog in
Avatar of sglee
sglee

asked on

Source path too long

User generated imageHi,
  I have a weird situation. I have a folder "C:\Data\Invoice\Backup" and in it, I have so  many sub-folders created by ROBOCOPY.
  At first I wanted to simply delete the folder by clicking [Delete] button, but I keep getting this error message about "The source file names are larger than ...".
  I googled this error message and found an article where the author suggested that I rename all these sub-folders to 1 letter length and delete the folders afterwards.
  I followed that suggestion and that is the reason why you see so many 'a'. It was somewhat effective, but no all of the files are being deleted and it is taking too much time to rename folders.
  . When I run a DOS command "DIR /s /w" to list all the sub-folders, I see the following:
     
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 Directory of C:\Data\Invoice\Backup\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\1\1\1\1\1\1\1
\1\1\1\1\1\1\1\a\1\a\c\a\a\a\1\a\a\a\a\1\1\1\1\1\1\1\1\1\3\1\1\1\1\1\1\1\1\1\1\1
\2\1\1\3\1\1\3\1\1\3\2\1\1\1\1\2\1\1\1\1\1\1\1\1\2\1\2\2\1\1\3\1\1\3\1\1

[.]
[..]
05102011_Honda_pay_online_receipt.asp.htm
[05102011_Honda_pay_online_receipt.asp_files]
[2]
Data2000 - 2018 May 7 with blank username_password table.mdb
Company_PurchaseOrderNo_ForYear_2010_2011.pdf
RealData_NewCreditApplication_634408115979365633.pdf
               4 File(s)     24,697,752 bytes
The directory name C:\Data\Invoice\Backup\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\1\1\1\1\
1\1\1\1\1\1\1\1\1\1\a\1\a\c\a\a\a\1\a\a\a\a\1\1\1\1\1\1\1\1\1\3\1\1\1\1\1\1\1\1\
1\1\1\2\1\1\3\1\1\3\1\1\3\2\1\1\1\1\2\1\1\1\1\1\1\1\1\2\1\2\2\1\1\3\1\1\3\1\1\05
102011_Honda_pay_online_receipt.asp_files is too long.

     Total Files Listed:
               8 File(s)     98,112,273 bytes
             295 Dir(s)  20,178,972,672 bytes free
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Is there any other way to remove this folder from the root (C:\Data\Invoice\Backup\a)?

Thanks.
Avatar of Russ Suter
Russ Suter

I've encountered this problem before. 7-zip's file manager seems to be able to work around the issue. You can delete the files from within there.
I guess I would move all the files to a sane location, then use DELTREE to delete all those subfolders.
or drop to command prompt, and remove manually....

seen this at many Schools..... students do it for a laugh, because explorer cannot handle long paths!
Avatar of sglee

ASKER

@Russ,
Let me try 7 Zip.
Avatar of sglee

ASKER

@Andrew
"or drop to command prompt, and remove manually...." --> how do you do that?
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

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
Avatar of sglee

ASKER

@John,
Is Long Path Erase is free or commercial?
Avatar of sglee

ASKER

@Russ
In 7 Zip, I could not delete them.
Avatar of sglee

ASKER

@Paul
DELTREE does not work on Server 2008.
free as a bird...here is the direct download link
Avatar of sglee

ASKER

@John
LongPathEraser is a killer!
Thank you!
Avatar of sglee

ASKER

User generated imageUser generated imageI spoke too soon. LongPathErase worked to an extent. It freed up about 30GB of data from the folder. Now every time I open the program, select the folder and click [Delete] button, it fails to run the program.
How about rebooting the machine...
Avatar of sglee

ASKER

@John
I restarted the computer and re-ran it. It still crashes. The difference was that it looks longer to crash compare to prior to reboot.
What if you choose some folders deeper...is there a chance of permissions issue...i see the lock..so what if you run LPE as administrator
Avatar of sglee

ASKER

@John,
I had tried running as "administrator" already.
I also tried to delete a sub-folder towards the end of list of sub-folders.
When I have more time, I will try a different level of sub-folders later.
Well here is another solution...i can't say i have tested it but if nothing helps...then..
In the article besides the solution there is also mention of using a Linux Live CD ...mounting the file system and erasing...i am not 100% sure about that..i can't remember i have done it in the past..so if any member has first hand experience it would be helpful
Avatar of sglee

ASKER

Ok. I will give that a shot.
drop to a command prompt

change directory to backup

and then type rd . /S
Avatar of sglee

ASKER

@Andrew
"rd . /S" did not work. It still complains about "The file name is too long".
in that case, you will need to enter each folder, and use  
rmdir

Open in new window


you may want to check what is causing it in he first place!

which was my fist suggestion!

Should not take too long, and in fact you could have done it by now..... time you've spent in this question!
Avatar of sglee

ASKER

User generated imageUser generated image@John
(1) I downloaded node-v8.11.1-x64.msi and installed it on the computer.
(2) Restarted the computer.
(3) I ran npm i -g rimraf in command prompt.
C:\Data\Invoice\Backup>npm i -g rimraf
C:\Users\admin\AppData\Roaming\npm\rimraf -> C:\Users\admin\AppData\Roamin
g\npm\node_modules\rimraf\bin.js
+ rimraf@2.6.2
added 12 packages in 4.719s
(4) Then I ran C:\Data\Invoice\Backup>rimraf a

Since then, the  node.exe RAM usage was on the rise for a while and is fluctuating. CPU utilization fluctuates too.
I will report back when it is done.
Avatar of sglee

ASKER

@Andrew
"you may want to check what is causing it in he first place!" --> The wrong use ROBOCOPY /MIR command created this problem. The damage is done and I need to remove these layers of sub-folders to free up space on the hard drive.
Avatar of sglee

ASKER

User generated image@John
"C:\Data\Invoice\Backup>rimraf a" command is finally executed and it was a success. The folder 'a' is gone and it freed up about 280GB of space.
I started running "rimraf b" and I can already see more free space on the C drive,
Avatar of sglee

ASKER

@Andrew
"oh dear!!!!" ---> I said "OMG" when I realized what I did with ROBOCOPY command.
Avatar of sglee

ASKER

@John
Finally folder 'b' is also removed and now I have 600GB free space.
Thank you for your help and I appreciate it.
Avatar of sglee

ASKER

@moderator,
 
 I like to re-assign points since the final solution was discovered after my initial point award.