File/Path Names > 265 Characters

Hi guys,

I have the task in work to archive all old job folders from the company server to DVD. Whenever I add a file to the DVD which has a name (including the path name) larger than 256 characters it throws back an error message informing me that if I do not rename the file then it may corrupt the DVD.

I was hoping there would be a lister field but unfortunately not.

Is there a simple way to list all files that have a file name and path larger than 256 characters...?

Any help would be most appreciated.

Regards,

Roly

I had a somewhat similar problem a couple years ago when a friend wanted me to show him a way to identify all full file name lengths that were greater than 150 total characters. The best solution I came up with was to download the free strings.exe utility from sysinternals.com and incorporate that in a batch file.

After downloading strings.exe I wrote the batch file which would first parse the filenames of the directory in question (in my example it was C:\mine) and it generated a filelist of all the files in that directory including subdirectories. The second step used the strings.exe tool to parse that filelist and it generated a second file list of all files that exceeded 150 total characters. I don't know if that could be of any help to you, but it might be one possibility. The link to the strings.exe download and the basic batch file I wrote follows:

http://technet.microsoft.com/en-us/sysinternals/bb897439.aspx

[code]@echo off
echo Working...Please Wait

dir "C:\mine*.*" /b/s/a:-d/o:n >C:\file1.txt

strings -n 150 -q "C:\file1.txt">"C:\file2.txt"

pause
exit[/code]

You would need to change C:\mine\ to the folder or drive you want to process and in the line that begins with strings, you would need to change 150 to 256. In the end C:\file2.txt should contain your list of file names greater than 256.

Bear in mind this could be a very lengthy process depending upon how many files you have to scan.

On second thought this IS Opus, so something like this might be easier and actually work better.

Try creating a filter set up something like below only instead of the 60 some ? characters (where each ? will match any one character in a file name) use 255 question marks. I haven't tried this so I don't know if this will exceed the maximum limits of the Opus filter system or not. In theory however, it should show a list of all file names 256 characters long or longer.


The 255 question marks method could match a very long name, or a very long path, but it's not perfect for finding things where path + name are long. You might have a path that's 200 chars long and a filename that's 100 chars long, so the full path is 300 chars, but they slip through the filter.

Maybe doing something like finding all files that have a path longer than 200 characters or a name longer than 55 characters would give you a small enough list that you can vet the results by hand. I think that would include all the files with paths longer than 255 (unless my sleepy head isn't thinking straight), but it may also include a few false positives (e.g. short path and 60 char name).

You could probably do an all-in-Opus perfect solution by abusing VBScript renaming but I think I'd use John's batch file instead, since it's already made and does the job.

duh. My question mark filter answer was really off the cuff like quick and you're right Leo, it doesn't account for the total of path and file name length, just one or the other. My bad. :blush:

I had a somewhat similar problem a couple years ago when a friend wanted me to show him a way to identify all full file name lengths that were greater than 150 total characters. The best solution I came up with was to download the free strings.exe utility from sysinternals.com and incorporate that in a batch file.

After downloading strings.exe I wrote the batch file which would first parse the filenames of the directory in question (in my example it was C:\mine) and it generated a filelist of all the files in that directory including subdirectories. The second step used the strings.exe tool to parse that filelist and it generated a second file list of all files that exceeded 150 total characters. I don't know if that could be of any help to you, but it might be one possibility. The link to the strings.exe download and the basic batch file I wrote follows:

http://technet.microsoft.com/en-us/sysinternals/bb897439.aspx

[code]@echo off
echo Working...Please Wait

dir "C:\mine*.*" /b/s/a:-d/o:n >C:\file1.txt

strings -n 150 -q "C:\file1.txt">"C:\file2.txt"

pause
exit[/code]

You would need to change C:\mine\ to the folder or drive you want to process and in the line that begins with strings, you would need to change 150 to 256. In the end C:\file2.txt should contain your list of file names greater than 256.

Bear in mind this could be a very lengthy process depending upon how many files you have to scan.[/quote]

John, this is brilliant mate. It worked a treat.

Thanks a lot for your help.

This would be a piece of cake if DOpus supported searching by full path (directory+filename) and the {n,m} notation as found in many POSIX-style regex implementations.

You could then just do something like:

Fullpath Match ".{255,}"

Just dreaming here :wink:

I know this is an OLD thread but I thought it worthwhile posting that this is all possible now within Dopus (12).

Posting because when I searched Google for a way to do this, this old thread came up. So it may help someone.

4 Likes