CmdID

CmdID / Commands

copy

Copies one or more files from one location to another. Windows commands reference

On Windows, DOS

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0

Copies one or more files from one location to another. NOTE: You can also use the copy command, with different parameters, from the Recovery Console. For more information about the recovery console, see Windows Recovery Environment (Windows RE).

copy [/d] [/v] [/n] [/y | /-y] [/z] [/a | /b] <source> [/a | /b] [+<source> [/a | /b] [+ ...]] [<destination> [/a | /b]]
File cannot be copied onto itself
0 File(s) copied
copy /b <source> +,,

To copy a file called memo.doc to letter.doc in the current drive and ensure that an end-of-file character (CTRL+Z) is at the end of the copied file, type

copy memo.doc letter.doc /aIdentify
/aIndicates an ASCII text file. Windows commands reference

To copy a file named robin.typ from the current drive and directory to an existing directory named Birds that is located on drive C, type

copy robin.typ c:\birdsIdentify

To combine Mar89.rpt, Apr89.rpt, and May89.rpt, which are located in the current directory, and place them in a file named Report (also in the current directory), type

copy mar89.rpt + apr89.rpt + may89.rpt ReportIdentify

To combine all files in Report, when a file named Report already exists, type

copy report + mar89.rpt + apr89.rpt + may89.rptIdentify

To combine all files in the current directory that have the .txt file name extension into a single file named Combined.doc, type

copy *.txt Combined.docIdentify

To combine several binary files into one file by using wildcard characters, include /b. This prevents Windows from treating CTRL+Z as an end-of-file character. For example, type

copy /b *.exe Combined.exeIdentify
/bIndicates a binary file. Windows commands reference

Combining each file that has a .txt extension with its corresponding .ref file creates a file with the same file name, but with a .doc extension. The Copy command combines file1.txt with file1.ref to form file1.doc, and then the command combines file2.txt with file2.ref to form file2.doc, and so on. For example, type

copy *.txt + *.ref *.docIdentify

To combine all files with the .txt extension, and then to combine all files with the .ref extension into one file named Combined.doc, type

copy *.txt + *.ref Combined.docIdentify
/dAllows the encrypted files being copied to be saved as decrypted files at the destination.
/vVerifies that new files are written correctly.
/nUses a short file name, if available, when copying a file with a name longer than eight characters, or with a file name extension longer than three characters.
/ySuppresses prompting to confirm that you want to overwrite an existing destination file.
/-yPrompts you to confirm that you want to overwrite an existing destination file.
/zCopies networked files in restartable mode.
/aIndicates an ASCII text file.
/bIndicates a binary file.
<source>Required. Specifies the location from which you want to copy a file or set of files. Source can consist of a drive letter and colon, a directory name, a file name, or a combination of these.
<destination>Required. Specifies the location to which you want to copy a file or set of files. Destination can consist of a drive letter and colon, a directory name, a file name, or a combination of these.
/?Displays help at the command prompt.

Windows

from tldr-pages, CC BY 4.0

Copy files from one location to another. In PowerShell, this command is an alias of Copy-Item. This documentation is based on the Command Prompt (cmd) version of copy.

Copy a file to another location

copy path\to\source_file path\to\target_fileIdentify

Copy a file into another directory, keeping the filename

copy path\to\source_file path\to\target_directoryIdentify

Copy multiple files to a directory

copy path\to\file1 path\to\file2 ... path\to\target_directoryIdentify

Copy all files from one directory to another directory

copy path\to\source_directory\* path\to\target_directoryIdentify

Copy files with a specific extension

copy path\to\source_directory\*.ext path\to\target_directoryIdentify

Copy a file and prompt before overwriting

copy /-y path\to\source_file path\to\target_fileIdentify

Copy files.

Copy a file

COPY path/to/source_file path/to/destination_fileIdentify