Renaming Files While Copying May Cause CorruptionLast reviewed: May 8, 1997Article ID: Q103040 |
The information in this article applies to:
SYMPTOMSWith the Windows NT command prompt, if you use the COPY command to copy a file from one directory to another, you cannot rename the file simultaneously if you are using wildcards in the command line. For example, if you have one file called TEST.EXE in a directory called ATEST, and you want to rename the file to BINARY.EXE while copying it, the file will be corrupted if you use the following command line:
copy c:\atest\*.exe c:\binary.exeThe file will be partially copied, but will truncate at the first instance of CTRL-Z (EOF) in the file, causing a corrupted file.
WORKAROUNDTo work around this problem, use a /b switch in front of the source file. This will correctly complete the copy and rename operation. For example:
copy /b c:\atest\*.exe c:\binary.exeDo not place the /b after the destination file. If you use a /b after the destination file as in the following example, the destination file will be corrupted:
copy c:\atest\*.exe c:\binary.exe /bAlso, using the following command is the best way to copy and rename a file:
copy c:\atest\test.exe c:\binary.exe STATUSMicrosoft has confirmed this to be a problem in Windows NT version 3.1 and Windows NT Advanced Server version 3.1. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
|
Additional query words: prodnt cmd
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |