copy
Copies one or more files from one location to another. Windows commands reference
On Windows, DOS
Windows
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 itself0 File(s) copiedcopy /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 referenceTo 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:\birdsIdentifyTo 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 ReportIdentifyTo combine all files in Report, when a file named Report already exists, type
copy report + mar89.rpt + apr89.rpt + may89.rptIdentifyTo 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.docIdentifyTo 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 referenceCombining 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 *.docIdentifyTo 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
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_fileIdentifyCopy a file into another directory, keeping the filename
copy path\to\source_file path\to\target_directoryIdentifyCopy multiple files to a directory
copy path\to\file1 path\to\file2 ... path\to\target_directoryIdentifyCopy all files from one directory to another directory
copy path\to\source_directory\* path\to\target_directoryIdentifyCopy files with a specific extension
copy path\to\source_directory\*.ext path\to\target_directoryIdentifyCopy a file and prompt before overwriting
copy /-y path\to\source_file path\to\target_fileIdentifyDOS
Copy files.
Copy a file
COPY path/to/source_file path/to/destination_fileIdentify