Copying from CON to a Subdirectory Doesn't Result in Error (66531)



The information in this article applies to:
    Microsoft MS-DOS operating system

This article was previously published under Q66531

SYMPTOMS

If you have a directory called C:\TEMP and you try to create a file called TEMP using the COPY CON command as follows
   C:\>copy con temp
   hello
   ^Z
instead of creating a file called TEMP, MS-DOS echoes "hello" and "1 file copied" on the screen as follows:
   C:\>copy con temp
   hello
   ^Z
   hello
          1 file(s) copied
No error message is displayed.

CAUSE

This is expected MS-DOS behavior. When C:\TEMP is a directory, the command
   C:\>copy con temp
is the same as
   C:\>copy con C:\temp\*.*
-or-
   C:\>copy con C:\temp\con
CON is short for console and consists of the keyboard (input) and the display (output). It always exists, even in subdirectories. Therefore, this command copies input from CON (keyboard) to CON (display).

Modification Type: Major Last Reviewed: 9/30/2003
Keywords: KB66531