Microsoft KB Archive/65161

XCOPY Fails If Subdirectory Name Exceeds 64 Characters PSS ID Number: Q65161 Article last modified on 07-14-1993 PSS database name: O_MSDOS

3.x 4.00 4.01

MS-DOS

Summary:

When copying a subdirectory tree using XCOPY /S, the copying process does not complete properly if the source pathname or any destination path exceeds 63 characters. This condition may occur even if the source and destination paths specified on the command line do not exceed this limit, due to the nesting capabilities of XCOPY.

The portion of the pathname that cannot exceed 64 characters is the directory list, exclusive of the filename and the drive letter. If a source or destination drive is a drive created with the SUBST command; the length of the maximum path may be shorter. In this case, the length of the SUBST’d path added to the nested path on the SUBST’d drive must not exceed 64 characters.

If the following SUBST command is used

SUBST w: C:

the path W: has a total length of 20 characters and is equivalent to C:.

More Information:

This problem occurs when a deep subdirectory tree is XCOPY’d to another deep subdirectory tree (using the /S XCOPY option), thus creating a directory tree that has a depth equal to the sum of the two original directory trees. When XCOPY generates a full pathname for a source or target file, and that pathname exceeds 63 characters, the XCOPY command terminates. No error message is displayed, but the following standard message is displayed:

xx file(s) copied.

The number listed in this message (xx) is less than the actual number of files that exist in the source directory tree (those files that should have been copied).

Microsoft has confirmed this to be a problem with MS-DOS versions 3.20, 3.21, 3.30, 3.30a, 4.00, and 4.01. This problem does not occur in later versions of MS-DOS.

Additional reference words: 3.20 3.21 3.30 3.30a 4.00 4.01 noupd

Copyright Microsoft Corporation 1993.