Copy

Action: Copies one or more files or directories.
 
Syntax: COPY "source" "target" [/c] [/h] [/r] [/s]
/c Continue copying, even if error(s) occur.
/h Copies hidden and system files also.
 
/r Overwrite read-only files on target.
/s Copies files and subdirectories (including empty subdirectories).
Remarks:

If the source or target specifies a directory, please make sure to add a trailing backslash.

Wildcards are supported.

If a file already exists at the target, it is overwritten without warning.

If the /c argument is not specified, and an error is encountered, the copy process will be aborted.
 

See Also: CD, Del, Go, MD, Move, RD
 
Examples: ; The following examples copy all files in MyDir to NewDir
COPY "S:\MyDir\*.*" "S:\NewDir\*.*"
COPY "S:\MyDir\." "S:\NewDir\."
COPY "S:\MyDir\" "S:\NewDir\"

; If the target (directory) does not exist,
; and the target specification does not have a
; trailing backslash, COPY will fail with an
; errorcode 3 ("path not found")
COPY "S:\MyDir\" "S:\NewDir" ; fails if NewDir does not exist

; This command will copy all files that match
; the wildcard specification and change their
; extension to '.bak'
COPY "MyDir\file*.txt" "MyDir\file*.bak"