Jump to content

XP automatically shortens long file names to 8 characters


Cixert

Recommended Posts

This is a problem that I have had without a solution for a long time, I use FAT32.
When I copy multiple folders if any file has a name that exceeds the Windows file length limit then XP copies it without giving any error and changing the long name to a short one with 8 characters and "~" symbol.

For example, if the file has the name:
"program to read documents PDF.exe"
Windows XP renames it without giving any error to:
"program~.exe"

Apparently the file keeps its real name somewhere, since a shortcut still finds it with the short name, but it prevents me from knowing the true name of the file.

I would like to know how:
1-Be able to see the long file name again.
2-What Windows XP gives an error message when I am copying a file with a long name that exceeds the limit, instead of automatically changing the name.

I don't have this problem in Windows 2000, so when I go to copy and paste a lot of files I have to restart and use w2K, which gives me an error that it can't copy long names instead of renaming them.

Edited by Cixert
Link to comment
Share on other sites


Check this, though it is improbable:

https://learn.microsoft.com/en-us/archive/blogs/astebner/registry-key-to-force-windows-to-use-short-filenames

Quote

Key name: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem

Value name: Win31FileSystem

Data type: REG_DWORD

Setting this value to 0 will allow Windows to use long filenames. Setting this value to 1 will force Windows to use short filenames.

Maybe it is *something else* that *somehow* prevents the proper setting of the secondary entry, you could check the actual file/folder entry on the filesystem:

https://www.ntfs.com/fat-filenames.htm

AFAIK the long and short filenames are two separate entries (the short filename one is automatically generated at file creation), which explains why you have your long file name shortcuts still working, so it could be *something* that only shows the short filename.

Does this happen with *any* copy utility/method or just with a given one?

As well, do you see the short file name with *any* tool (dir from command line, explorer, other file manager, etc.) or just in a given one?

Are you sure that the issue is with filenames (and not with long PATH)?

 

jaclaz

Link to comment
Share on other sites

  • 2 weeks later...
On 12/13/2022 at 10:42 AM, jaclaz said:

Check this, though it is improbable:

https://learn.microsoft.com/en-us/archive/blogs/astebner/registry-key-to-force-windows-to-use-short-filenames

Maybe it is *something else* that *somehow* prevents the proper setting of the secondary entry, you could check the actual file/folder entry on the filesystem:

https://www.ntfs.com/fat-filenames.htm

AFAIK the long and short filenames are two separate entries (the short filename one is automatically generated at file creation), which explains why you have your long file name shortcuts still working, so it could be *something* that only shows the short filename.

Does this happen with *any* copy utility/method or just with a given one?

As well, do you see the short file name with *any* tool (dir from command line, explorer, other file manager, etc.) or just in a given one?

Are you sure that the issue is with filenames (and not with long PATH)?

 

jaclaz

ok, I thought that the double name was only in NTFS, I read that in FAT too.

 The problem is that when I copy and paste a file into a long path, that it exceeds the character limit. Windows XP automatically renames a file with a long name to a file with 8 characters.

 If XP does not achieve 8 characters it gives an error, but if it can it automatic renames.  This does not happen to me in windows 2000, it always gives a long path error.  Does it only happen to me on XP?  This has been happening to me since 2001.

is it possible to recover in the File Allocation Table the original long file name?

Both in the console and in Total Commander it shows the short name of the renamed file.

The registry entries you comment are fine

Link to comment
Share on other sites

  • 2 months later...

I have found a way to disable duplicate creation of 8.3 short names on FAT32 plus NTFS but this does not apply when it exceeds the 260 character path, in which case XP automatically renames long files to 8.3, when the folders are copied.
This issue does not happen on Windows 2000.

To disable:
fsutil behavior query disable8dot3 1

To enable:
fsutil behavior query disable8dot3 0

To check status:
fsutil behavior query disable8dot3

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-behavior

On the other hand, I have read here that it is convenient to disable the function of creating duplicate names.I don't know if this can cause problems, for example with tools to recover the system that work from CD-ROM or floppy disk.
https://ttcshelbyville.wordpress.com/2018/12/02/should-you-disable-8dot3-for-performance-and-security/

BEWARE the commands of the last link do not apply in XP.
(not to be confused with the NT 6 fsutil 8dot3name command)

I have found the following tools to detect long paths:
-Long Path Tool (also copies long paths) (demo)
-TLPD (Too Long Paths Detector)
-Path Scanner (trial 13 uses)
-Robocopy, command to copy folders from Windows Server 2003 Resource Kit Tools

Edited by Cixert
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...