Cannot Delete Long File Name Files

  • Thread starter Thread starter alfred schmidt
  • Start date Start date
A

alfred schmidt

I copied some files to my laptop for the purpose of making
CDs to archive data. Because I did not copy to the root
directory on laptop, copying to a subfolder resulted in a
LFN longer than the 259 limit. Is there a way to delete
these two files? Disk is NTFS format.
 
I figured out the solution to my own problem. It was
easily accomplished by renaming all the parent folders to
single character names, thus reducing the path name
length. Once the path name had less than 259 characters, I
could then delete the files.
 
Just for FYI, 256 characters is the limit on path/filename
length. It's a hex limitation.
 
renaming all the parent folders to
single character names, thus reducing the path name
length.

More general solution: Use dir /x to get the short file names and delete
those. (cmd.exe)
 
In my experience it's more complicated that 256 characters - some
utilities can cope with paths/names that are longer than 255 chars,
obviously the underlying NTFS file system can, and some can't, Windows
explorer for example can't (that's 32 bit programming for you, can't
cope with a number that won't fit into a byte!) This user managed to
copy a set of folders and created a path longer than 255 chars - but
then the delete command did't work. So file copy works differently than
file delete what brilliant design, such consistent programming.

I just wish that Microsoft would fix the file system so that it was
either impossible to create a path longer than 255 OR make all the
utilities that manipulate files work with the maximum path that it's
possible to create.
 
Back
Top