COPY
----

Format:        COPY source [/A] [/H] [dest [/A] [/T]]

Purpose:       Copies  data from a file or device to  another 
          file or device.

Use:           source consists of:

                     filespec | device

               If  a filespec is given,  then  the  specified 
          files are copied, which may include hidden files if 
          the /H option is given.  If a device is given, then 
          data is read from the device. 

               Similarly dest consists of:

                    filespec | device

               If  the filespec contains ambiguous characters 
          ('?',  or '*' which is just a series of '?'),  then 
          each   ambiguous  character  is  replaced  by   the 
          corresponding  character from the source  filename, 
          thus  allowing  the  files to  be  renamed  in  the 
          process.  If the source is a device and the dest is 
          ambiguous, then an error will be given.

               The  /A option controls whether the data being 
          copied  is  to be treated as ASCII  or  binary,  as 
          described below.

               On  the source,  /A means that all data up  to 
          and including the first control Z or until the  end 
          of  file will be read,  although the control Z will 
          not be copied. Otherwise all data will be read.

               On the dest,  /A means that all data up to but 
          not including the first control Z will be  written, 
          and then a single control Z will be appended to the 
          data written.  Otherwise, all data will be written, 
          and no other characters will be added to the data.

               If  an  ambiguous  filename is  given  on  the 
          source,  then  the  filenames will be displayed  as 
          they are copied. If an error occurs during the copy 
          or if the ctrl-ESC (stop) key is pressed,  then all 
          necessary  files  will  be  closed  and  the  error 
          returned.   Note  that  under  some   circumstances 
          pressing  ctrl-ESC  may in fact be the only way  to 
          terminate the copy,  for example when copying  from 
          the serial device without the /A option.

               When  copying  from  more than one file  to  a 
          device,  the  data  will be written one file  at  a 
          time,  with  a control Z appended on to the end  of 
          the data if necessary.

               When  copying from one file  to  another,  the 
          attributes  are not affected,  and the  destination 
          file  is  given  the same attributes  as  the  old. 
          Similarly,  the  destination file is given the same 
          date and time values as the source, although if the 
          /T  option is specified then the new file is  given 
          the  current date and time instead.  To change  the 
          attributes of the new file, the ATTR command should 
          be used.

Examples:

     COPY FRED B:

               The  file  FRED  is  copied  to  the   current 
          directory of drive B:


     COPY A:\BOOT\AUTOEXEC.BAT B:\

               The   AUTOEXEC.BAT  file  from  the  specified 
          directory  on  drive  A:  is  copied  to  the  root 
          directory of drive B:.


     COPY A:\BOOT B:\BOOT

               All the files in the directory BOOT from drive 
          A: are copied to a similar directory on drive B:.


     COPY B:

               All files in the current directory of drive B: 
          are copied to the current directory of the  current 
          drive.


     COPY *.TXT PRN:

               All  files  with  an extension of TXT  in  the 
          current  directory of the current drive are  copied 
          to the printer.
