The copy Command Prompt command duplicates a file, storing the second version in a different location of your choosing.

Use the command to copy a file using its specific name and file extension or use a wildcard to copy groups of files at once, regardless of the file names or extensions. Some other command options include verification that the files were copied correctly and suppression of prompts to overwrite files of the same name.

Copy Command Availability

The copy command is available from within the Command Prompt in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP, as well as from the Advanced Startup Options and System Recovery Options repair/recovery menus.

Copy Command Syntax

The command accepts the following general form:

The availability of certain copy command switches and other command syntax might differ from operating system to operating system.

copy [/d] [/v] [/n] [/y | /-y] [/z] [/l] [/a | /b] source [/a | /b] [+ source [/a | /b] [+ …]] [destination [/a | /b]] [/?]

See How to Read Command Syntax if you’re not sure how to interpret the copy command syntax as it’s described above or in the list below.

Append files by choosing several source files but just one destination file.

Copy Command Examples

Below are several examples of how to use the copy command:

Copy to a Different Folder

copy Z:\Software\program.iso C:\Users\Jon\Downloads\Programs\

The copies program.iso from the Z: drive to the user’s Programs folder.

Copy and Rename

copy Y:\install\j93n.exe Y:\more\m1284.msi

You can use the copy command to rename a file and even change its file extension. In this example, the j93n.exe file copies to a new folder on the Y: drive as m1284.msi.

copy D:\i386\atapi.sy_ C:\Windows\atapi.sys

In the above example, the atapi.sy_ file, located in the i386 folder on the Windows XP installation CD, is copied to the C:\Windows directory as atapi.sys.

This isn’t a file conversion technique (i.e., the EXE file isn’t really being converted to MSI) but instead a way to make an identical copy but with the destination file saved under a different name and inside a different folder.

Unlike the Y: drive example above, this one is a bit more realistic, since copying files like that from a disc is a common practice when fixing some specific Windows problems.

Copy to Current Path

copy D:\readme.htm

In this example, the copy command has no destination specified, so the readme.htm file is copied to whatever directory you typed the copy command from.

For example, if you type copy d:\readme.htm from the C:\Windows> prompt, that HTM file will be copied to C:\Windows.

Copy Only Certain File Types

copy /y /v C:\Users\Jon\Downloads*.mp3 C:\Users\Jon\Music\DownloadedMusic\

This command copies all MP3s (*.mp3) from the Downloads folder to the Music\DownloadedMusic\ folder, but we want to make sure that every file is copied, even if there’s already one in DownloadedMusic with the same name (/y). We’ll verify the copy (/v) to make sure Command Prompt tells us whether the files were actually copied or if an error happened in the process.

Merge Files Into One

copy Z:\file1.txt+Z:\file2.txt+Z:\file3.txt Z:\combined.txt

This will merge three TXT files into a new one called combined.txt. As you can see, each file that should be part of the merge need to be separated by a + sign, but no spaces.

A folder has to already exist in the destination location before the copy command will copy files to it. Make new folders in Command Prompt with the mkdir command.

You can also use the asterisk to append multiple files. So, in our example, we could replace all those .txt instances with Z:*.txt, but only if we want to merge every single TXT file from the Z: drive.

This command is similar to the xcopy command, but unlike copy, xcopy works on folders, too.

Get the Latest Tech News Delivered Every Day

  • Xcopy Command

  • How to Change the Windows Startup Sound

  • Net Send Command

  • More Command

  • Rename Command

  • How to Use the Netstat Command

  • Vol Command Examples and Options

  • Sfc Command (System File Checker)

  • Net Command

  • How to Restore Hal.dll From the Windows XP CD

  • How to Restore Deleted Files From the Recycle Bin

  • The Complete List of Command Prompt (CMD) Commands

  • How to Redirect Command Output to a File

  • How to Use the Net Use Command in Windows

  • Msg Command (Examples, Switches, and More)

  • How to Move Your iTunes Library to a New Location

  • Facebook

  • Twitter

Hit Refresh on Your Tech News

  • About Us

  • Privacy Policy

  • Editorial Guidelines

  • Terms of Use

  • Careers

  • Advertise

  • Contact

  • EU Privacy

  • NEWS

  • HOW TO

  • FEATURES

  • ABOUT US