Utility to check if path+filename exceeds 255 chars

M

Mark M

Is there a utility for XP to check if any pathname + filename of any
file in a set of folders is too long?

XP/NTFS5 actually allows you to rename and lengthen the name of
folders in the path of a file even if final pathname + filename of
some file exceeds the 255 character limit.

But when one moves a set of folders, XP will terminate the whole move
operation midway through if it comes across a too-long file name.

Nor does XP identify the path causing the problem.

So I'm looking for a utility which can do a pre-move check to
identify if any too-long names have been used.
 
P

Pegasus \(MVP\)

If you run this batch file from your the folder to be
examined then it will flag excessively long file names.
Note that it won't process files names that contain
certain special symbols such & (e.g. P&Q.txt).

@echo off
setlocal EnableDelayedExpansion
for %%a in (*.*) do (
set name=%cd%%%a
if not "!name:~253,1!"=="" echo Excessively long name: %%a
)
endlocal
 
M

Microsoft

Use Robocopy to perform your copies/moves. The current version supports
pathlengths > 255.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top