How to Copy Files in Command Prompt
This wikiHow teaches you how to use Windows' Command Prompt program to copy a file or folder. Find out your file's location. You'll need the file's location—also known as a 'directory'—in order to tell Command Prompt where to look for the f...
Part 1 of 3:
Preparing to Copy
-
Find out your file's location. You'll need the file's location—also known as a "directory"—in order to tell Command Prompt where to look for the file.- You can find the file's directory by going to the file's location in File Explorer and then clicking the URL bar near the top of the File Explorer window.
- Most files will be somewhere in the following directory: [drive letter]:Users[username] (for example, "C:UsersKyle"). This is the directory in which almost every user-created file on your computer is located.
- A file on your desktop for the above example would be in the "C:UsersKyleDesktop" directory, while a file in the Documents folder would be in the "C:UsersKyleDocuments" directory.
-
Know your file's name. If you want to copy your file, you'll need to know its name. Keep in mind that file names are case-sensitive in Command Prompt, so you'll need to include the proper capitalization. -
Open Start. Click the Windows logo in the bottom-left corner of the screen.
-
Type in command prompt. Doing so will search your computer for the Command Prompt program. -
ClickCommand Prompt. It's at the top of the Start window. Doing so will open the Command Prompt program.
- Keep in mind that if you're on a shared computer (e.g., a school or public PC), you may not be able to access the Command Prompt.
Part 2 of 3:
Copying Individual Files
-
Enter the "change directory" command. Type in cd followed by a space, but don't press ↵ Enter. -
Type in your file's directory. Enter the directory in which the file that you want to copy is located. -
Press ↵ Enter. Doing so will reset Command Prompt to look in the entered directory. -
Enter the "copy" command. Type in copy followed by a space, but don't press ↵ Enter yet. -
Enter your file's name. Type in your file's name followed by a space, making sure to include the file's extension (e.g., .txt) for a text file. Don't press ↵ Enter after doing so.- If there are spaces in the file's name, you need to put quotation marks around them. For example, a file named "Pickles are Good.txt" would be Pickles" "are" "Good.txt in Command Prompt.
-
Enter a destination directory. Type in another directory (e.g., C:Users[you]Desktop into which you want to copy the file.- If you don't do this, the file will be copied to your user directory (e.g., "C:Users[you]") by default.
-
Press ↵ Enter. Doing so will copy the file into your indicated directory. You can view the copied file by going to the directory in question in your computer's File Explorer.
Part 3 of 3:
Copying a Folder's Contents
-
Go to the folder's directory. Type in cd followed by a space, then type in the folder's directory and press ↵ Enter.- For example, if you want to copy all of the files inside of a folder called "Example" that's on your desktop, you'd go to C:UsershumpbDesktop here.
-
Enter the robocopy command. Type in robocopy and then a space, but don't press ↵ Enter yet. -
Enter a folder's name. Type in the name of the folder that you want to copy, then add a space. Again, don't press the ↵ Enter key just yet.- As with file names, you'll need to use quotes around any spaces in the folder name.
-
Enter a destination. Type in a directory into which you want to copy the folder's files.- If there are lots of files in the folder, this can get messy if you copy them into an unorganized folder since the folder itself won't be copied with the files.
-
Press ↵ Enter. Doing so will copy the contents of the folder into your destination folder.


