Files may be lost when you copy files from a source that uses both short file names and long file names

Article translations Article translations
Article ID: 195144 - View products that this article applies to.
This article was previously published under Q195144
Expand all | Collapse all

On This Page

SYMPTOMS

When you copy files from a source that uses both short file names and long file names, files may be lost.

This problem can occur when you perform the copy operation by using any of the following programs:
  • COPY
  • XCOPY
  • Windows NT Explorer
  • Windows NT Backup

CAUSE

This problem happens when a file that has a long file name is copied and a new short file name is generated for the file in the destination folder. If a file exists in the source folder and it has a name matching the newly generated short file name, this file will replace the first file and the content of the first file is lost. For example:
   Source Directory :

   C:\source> dir /x

   08/21/98  02:03p        <DIR>                          .
   08/21/98  02:03p        <DIR>                          ..
   08/20/98  02:32p                     17                YXXXXX~1.XXX
   08/20/98  02:32p                     7 YXXXXX~2.XXX    yxxxxxxxxx.xxx
     4 File(s)              14 bytes

   C:\source> copy *.* c:\dest
   yxxxxxxxxx.xxx
   YXXXXX~1.XXX
        2 file(s) copied.

   C:\source> dir c:\dest

   09/15/98  09:27a        <DIR>                          .
   09/15/98  09:27a        <DIR>                          ..
   08/20/98  02:32p                     17 YXXXXX~1.XXX   yxxxxxxxxx.xxx
     3 File(s)             17 bytes
				
Note The yxxxxxxxxx.xxx file is copied first, and the short file name generated for that is YXXXXX~1.XXX. When the copy program copies YXXXXX~1.XXX to the destination, it finds a match in file name and replaces the existing file with its contents.

In NTBackup, if the short named file and the NTFS converted long file names are the same, you are prompted whether to replace the existing file or not. Overwriting the file may result in data loss as the file names will be the same but the contents will not be.

RESOLUTION

Windows NT 4.0

To resolve this problem, obtain the latest service pack for Windows NT 4.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
152734 How to obtain the latest Windows NT 4.0 service pack

Windows 2000 with Internet Explorer

Service pack information

To resolve this problem, obtain the latest service pack for Windows 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
260910 How to obtain the latest Windows 2000 service pack

Hotfix information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
   Date      Time      Version         Size        File name
-------------------------------------------------------------
 5/11/2001   10:51a   5.0.3315.1000   2,337,552    Shell32.dll
				

Windows 95 with Internet Explorer 4.0

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. The Windows NT 4.0 version of this service pack has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
   Date      Time     Size       File name      Platform
   -------------------------------------------------------------
   03/02/99  06:40p  1,431,264   Shell32.dll   (Windows 95)

				
Note These hotfixes only fix copy operations that are performed by using Windows NT Explorer. By design, the behavior of COPY and XCOPY is unchanged. This behavior does also still apply for tools like ROBOCOPY or Powershell "copy-item -r". Other copy tools missing this special
logic might most likely be affected too and need the same mentioned workaround.

WORKAROUND

To work around this problem, turn off automatic short file name generation. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
210638 How to disable automatic short file name generation

Windows NT Backup

If the files that have short file names were created by legacy applications, and you cannot upgrade these applications, use the FAT formatted partitions on Windows NT servers for compatibility with these applications. Use share-level security. You can also use different folders for files that have long file names and files that have short file names.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Windows NT 4.0 Service Pack 5 and in Windows 2000 Service Pack 3.

Properties

Article ID: 195144 - Last Review: February 2, 2012 - Revision: 3.0
APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows NT Server 4.0 Enterprise Edition
  • Microsoft Windows 95
Keywords: 
kbhotfixserver kbqfe kbbug kbfix kbshell kbwin2000sp3fix KB195144

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com