Menu

« Do you need zip and/or unzip support in LotusScript? Download free DLL from here | Main| Find and optionally correct erroneous file names on your drive »

Find the long file names on your drives

Category Resources
Have you ever wondered whether your drive contains files with very long file names? I experienced a problem with my Home Server backup, where some of the files turned out to have very long file names (close to 255 characters). When files with that long file names are copied to other directories with perhaps a long folder name, the total characters in the path and file name exceed 255 characters, and the copy operation fail. I therefore needed a small application to reveal those file names.

The result is FindVeryLongFileNames.exe which by default scans the specified drive and path for file names longer than 200 characters. It also scans all subfolders. For example;

FindVeryLongfileNames C:\   - will scan your C-drive and all subfolders for long file names
FindVeryLongfileNames \\SERVER\Music   - will scan your network share \\SERVER\Music and all subfolders for long file names.

If you want to look for file names with names longer than for example 240 characters, you may specify;

FindVeryLongFileNames \\SERVER\Music   240     - will scan your network share \\SERVER\Music and all subfolders for file names longer than 240 characters

Note that the tool just outputs the results to the console. This means that you can use standard redirect-operation (use >) to redirect the output to a file. for example;

FindVeryLongFileNames \\SERVER\Music >c:\Longfile namesMusic.txt

When FindVeryLongFileNames finishes, you may see the result in the file c:\Longfile namesMusic.txt.

Since the tool outputs the file names on the format xxx - file name, you may sort the file too, with the standard SORT command, such as;

SORT c:\Longfile namesMusic.txt >c:\Longfile namesMusicSORTED.txt

Remember you can add the /REVERSE parameter to the SORT command to reverse the sort order to descending.

You may download the tool here.