1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Long File Names Truncating

Discussion in 'Software' started by grumpy_toad, Aug 30, 2009.

  1. grumpy_toad

    grumpy_toad Private E-2

    When I copy long file names to an external hard drive, the file names randomly shorten to six capital letters+tilde+number. This does not happen consistently, though. Curiously, if I transfer a file folder with a file having the same name inside, the file folder will transfer intact, but the internal document will shorten. This does not happen between drives/partitions on my main computer, nor does it happen with all of my external drives (I have several external hard drives for video editing storage.). All of the drives in question are formatted to NTFS. The problem is annoying considering I have thousands of titles, and many now seem to be truncating to an unrecognizable title. I have changed the value of the 8.3 name in the registry from 0 to 1 and back again with no change in the random consistency of the file names truncating. Hopefully, the problem is a configuration matter somewhere. My OS is XP SP3.

    In conjunction, I have recently had several files reject copy due to length, even though the names are obviously much less than 255 characters. I do not think the issues are related, unless you take into consideration the mutual headache they both have blossomed.

    Any help or positive direction is greatly appreciated.

  2. Spad

    Spad MajorGeek

    Back up your registry first. In fact, you should back up your registry often, even if you don't intend to muck around with it. You'll feel better if you do.

    Check in your registry and make sure that long file names are enabled.

    Go to:


    In the right-hand pane find "NtfsDisable8dot3NameCreation" and right-click on it, and select "Modify"
    If the value box has a 1, then long file names are disabled. Change the 1 to 0 . Reboot.

    Hope this helps.
    Last edited: Aug 31, 2009
  3. Spad

    Spad MajorGeek

    Sorry . . . not sure how, but I missed that you had already tried that . . .

    You don't by chance use a Symantec product do you?
    Last edited: Aug 31, 2009
  4. grumpy_toad

    grumpy_toad Private E-2

    No problem, Spad. I appreciate the effort. This one is frustrating as I do not know what causes the truncation. Some files truncate, some do not. Most that do not have titles that are visually longer than those that do, though this is not always the case. Maybe there is something I am not physically seeing in the titles, such as the path. But if this were true, why does the directory folder not truncate also with the interior files? I am truly stumped...and tired of cutting and pasting titles from the folder file names.

    No, I do not use a Symantec product. I have not had much luck or success with them.

  5. plodr

    plodr Major Geek Extraordinaire

    It might not be the file name that is rejected but rather the length of the path.
    If it is very long like C:\Documents and Settings\your user name\My Documents\My Special folder\name of file.ext and this approaches 255 characters (everything included) you might get a rejection.

    Somewhere in the very dim recesses of my mind is the exact information. Unfortunately, I can't put my finger on it to post better details. Sorry. :(
  6. grumpy_toad

    grumpy_toad Private E-2

    Thanks for jumping in, Plodr. Just curious, this particular drive is mounted and does not have a drive letter. Could this be a major player in the length of the path? This may help to explain the length errors, but does it also explain the appearance of randomly shortening of the names while leaving other document titles in the same transfer intact? Why does the protocol outright reject some file names with an error message while using the tilde on others? How do I address this without causing errors in the files I have already transferrred? Once a file is shortened with the tilde, I have been going back and cutting and pasting the titles again or retyping them from the document. Is there a faster way to access the original title or is this the only way?

    Thanks again.

  7. plodr

    plodr Major Geek Extraordinaire

    Sorry, I don't have an answer to that.
    I've not seen anything like that. My external drive is always given a letter. I move it around between quite a few computers because I sometime put Acronis True images on it when I don't want to burn the image. It might be given a different letter depending on the computer it is attached to and the other hardware on the computer.
  8. grumpy_toad

    grumpy_toad Private E-2

    I have external hard drives set up both with "floating" drive letters and some that are mounted via a dedicated empty folder within a lettered partition. The floating letter drives always identify with a letter, while the mounted drives only register through their specific folders. Subfolders on the mounted drives representing individual partitions also do not have letters. I am now wondering if the extra levels of organization are having the unintended consequence of having some file paths being too long and thus truncating the file names. I also download numerous books, files, music and videos from external sources (I freely confess to being an avid, often obsessive knowledge collector.). More often than not, these files generate the long file name errors. Is it possible for these files to have hidden baggage in their titles? I have been able to edit the titles on most, but on the stubborn few, I have found I am able to save them to my main drives without issue. Once I identify and sort out a solution to my problem, I will transfer them to the appropriate mounted drive.
  9. techsent

    techsent Corporal

    Hi grumpy_toad,

    This may shed some light on the random truncating-


    you could try the dos xcopy command to see if that will help-

    start button/run/cmd

    then type xcopy /?

    or, maybe moving the files over instead of copying and then copy them back to their source folder. I know this sounds tedious but it may be a work around.

  10. techsent

    techsent Corporal

    Hi grumpy_toad,

    Im not sure if this will work but I've built a small visual basic Directory Copier program.

    I've tested it on a hard drive but I don't have an external to confirm.

    The proggy bypasses win explorer's gui so it completes much quicker.

    If all goes well, maybe I can add a progress bar, browse to directory and error checking.

    You'll know the copying is done when the hard drive light settles or you can watch the files paint the destination folder.

    Here's the internal code-

    hwnd As Long
    wFunc As Long
    pFrom As String
    pTo As String
    fFlags As Integer
    fAnyOperationsAborted As Long
    hNameMappings As Long
    lpszProgressTitle As String ' only used if FOF_SIMPLEPROGRESS
    End Type

    Private Const FOF_MULTIDESTFILES = &H1
    Private Const FOF_CONFIRMMOUSE = &H2
    Private Const FOF_SILENT = &H4
    Private Const FOF_NOCONFIRMATION = &H10
    Private Const FOF_WANTMAPPINGHANDLE = &H20
    Private Const FOF_ALLOWUNDO = &H40
    Private Const FOF_FILESONLY = &H80
    Private Const FOF_SIMPLEPROGRESS = &H100
    Private Const FOF_NOCONFIRMMKDIR = &H200

    Private Const FO_MOVE = 1
    Private Const FO_COPY = 2
    Private Const FO_DELETE = 3
    Private Const FO_RENAME = 4

    Private Declare Function SHFileOperation Lib "shell32.dll" (lpFileOp As SHFILEOPSTRUCT) As Long

    Public Function CopyFolder(ByVal strSource As String, ByVal strDest As String) As Boolean

    With varFOS
    .wFunc = FO_COPY
    .pFrom = strSource
    .pTo = strDest
    End With
    Call SHFileOperation(varFOS)
    CopyFolder = (varFOS.fAnyOperationsAborted = 0)
    End Function

    Private Sub Command1_Click()
    If Text1.Text = "" Or Text2.Text = "" Then
    MsgBox "Please enter the Source or Destination directory path.", vbInformation
    Exit Sub
    CopyFolder Text1.Text, Text2.Text
    End If
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    Unload Me
    End Sub

  11. techsent

    techsent Corporal

    2nd version

    Modified to include string variables-
    added doevents statement-

    Private Sub Command1_Click()
    If Text1.Text = "" Or Text2.Text = "" Then
    MsgBox "Please enter the Source or Destination directory path.", vbInformation
    Exit Sub
    'CopyFolder Text1.Text, Text2.Text
    Dim qq As String
    Dim qq1 As String
    qq = Text1.Text
    qq1 = Text2.Text
    CopyFolder qq, qq1
    End If
    End Sub


    Attached Files:

Share This Page

MajorGeeks.Com Menu

MajorGeeks.Com \ All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ NEW! PC Games \ System Tools \ Macintosh \ Demonews.Com \ Top Downloads

MajorGeeks.Com \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds