Copies one or more files or directories.



COPY "source" "destination" [/h] [/s]


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



Continue operation, even if errors occur.


Copies hidden and system files also.


Overwrite read-only files.


Copies directories and subdirectories, including empty ones.




Wildcards are supported.

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



; 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

; 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"