Proposed Solution to "Maximum path length exceeded" Error.

samedi 7 juin 2014

I understand that the actual error is NOT what is reported.

The problem is excessive length of Path PLUS LENGTH of Filename.

The problem is ACTUALLY with the destination to which recovered files are saved,

so saving to the root of X:\ will be more successful than saving to

X:\Long Folder Names Are My Habit\



Unfortunately Windows may break the rules and create path+name lengths that a user (and Recuva) is not allowed to do.

Such items must be excluded from any attempt to save complete with original path.



This should give you a list of all the Path+Filenames, starting with those that are so long they should be excluded



Download SysExporter from

http://www.nirsoft.n...ils/sysexp.html



Find deleted files (I am using Recuva64.exe v1.47.948.)



Launch SysExporter.

Select from the "Title" column Piriform Recuva

and choose from the "Type" column "List View".

After a long delay the bottom half of the display corresponds to the Recuva display,

then use Menu "Items" / "Choose Columns" and reverse the order of Filename and Path,

uncheck all the other boxes, and click OK.

Menu Items / Select All

Menu Items / "Copy Selected Items (Tab delimited)"



Launch Notepad and use Ctrl-V to paste the contents of the paste buffer into Notepad,

and save as a file Report.txt to a convenient folder (I use E:\Tools\Piriform\Recuva\v-1-47\)

Now create in the same folder the file

"Long.BAT" and copy into this



sort /R /+250 report.txt > Long.txt

Launch Long.BAT


and it will create the file Long.txt,

EDIT :- Enhancement that adds a calibrated ruler as a "header" to measures the length of a folder path plus name

"Header.BAT" and copy into this :-


@ECHO OFF & setlocal EnableDelayedExpansion
SET /A SORT=247
SET /A MAX=259
ECHO Script %~f0 revised %~t0
IF "%1"=="" CALL :S %SORT% & GOTO :EOF

:S
SET "STR=" & FOR /L %%N IN (0,10,%MAX%) DO SET "STR=!STR!....'....;"
SET /A NH=%1-1
SET /A NG=%MAX%-1
SET "STR=!STR:~0,%NH%!S!STR:~%1,%MAX%!"
ECHO !STR:~0,%NG%!M :- S(ort)=%1 M(ax)=%MAX% > REPORT.LST
MORE /T0 REPORT.TXT | sort /R /+%1 >> REPORT.LST

and this will create the file REPORT.LST that commences with the calbration ruler followed by a sorted list

which will show at the top of the list all the path+files which exceed 247 characters in length.



PLEASE NOTE

The output list of items is sorted in two sections.

The top section are all path-file-names with a minimum length of 247 characters,

followed by the section for all path-file-names with a miaximum length that is less than 247 characters.

For a different split just change the number in the second line which reads "SET /A SORT=247".

e.g. if you wish to "restore with folder structure" to a pre-existing path that is 20 characters long,

you cannot then restore anything that was more than 239 characters long, so a suitable command would be

SET /A SORT=227

You can also change the number in the third line if your system can use longer path-file-names than the 259 limit of my system



END OF EDIT



The actual limit for Windows is 259 characters (plus NULL terminator)

Whilst the NTFS limit is 32,000 character.

http://www.codinghor...s-too-long.html

I wonder what the Linux limits are :rolleyes:



EDIT SUPPLEMENTARY :-

After deselecting all items that are responsible for a "Maximum path length exceeded",

you can restore with folder structure,

after which the few which were selected can be restored without structure,

and then you can use Windows Explorer to shorten their names of shorten the restored folder strucure and then move those files as you wish.



N.B.

You will find a worked example in my recent bug report :-

http://forum.pirifor...036#entry237168



P.S.

I am shattered after debugging the clever bit of code

SET "STR=!STR:~0,%NH%!S!STR:~%1,%MAX%!"

I am in no condition to explain how that works, but these links will help you to also get a headache if you are interested

http://www.dostips.c...anipulation.php

http://www.dostips.c...ets.RightString

http://www.dostips.c...pets.LeftString

http://www.dostips.c...ppets.MidString



and there is expert advice available at

http://www.dostips.c...ewforum.php?f=3



CORRECTION

Some how stray text "with folder structure" became embedded in the code.

Now fixed at 20:18 15/07/2013


0 commentaires:

Enregistrer un commentaire

 

Lorem

Ipsum

Dolor