This wikiHow teaches you how to use the Command Prompt program in Windows to copy files or folders.
Step
Part 1 of 3: Preparing for Copy
Step 1. Find out the location of the file you want to copy
You'll need the location of the file (known as a "directory") in order to tell the Command Prompt to find the file you want.
- You can find the file's directory by opening the file's location in File Explorer and clicking the URL bar at the top of the window.
- Most files will be stored in the following directory: [disk name]:\Users\[username] (for example, "C:\Users\Kyle"). This is the directory that holds most of the files created by the user.
- In the example above, the files stored on the desktop are in the "C:\Users\Kyle\Desktop" directory, while the files stored in the Documents folder are in the "C:\Users\Kyle\Documents" directory.
Step 2. Know the file name
If you want to copy a file, you need to know the name of the file in question. Keep in mind that the case of the name matters when you use the Command Prompt so you need to capitalize it properly.
Step 3. Open the “Start” menu
Click the Windows logo in the lower-left corner of the screen.
Step 4. Type in command prompt
After that, the computer will search for the Command Prompt program.
Step 5. Click
"Command Prompt".
It's at the top of the “Start” window. After that, the Command Prompt program will be opened.
Keep in mind that if you use a shared computer (eg a school or public computer), you may not be able to access the Command Prompt program
Part 2 of 3: Copying Files Separately
Step 1. Enter the command "change directory"
Type cd followed by a space, but don't press Enter.
Step 2. Type in the file directory
Enter the directory to which you want to copy files.
Step 3. Press Enter key
After that, the Command Prompt will reset to check the directory you entered.
Step 4. Enter the "copy" command
Type in copy followed by a space, without directly pressing Enter.
Step 5. Enter a file name
Type in a file name followed by a space, and make sure the file extension is included (eg.txt for text files). Don't press Enter immediately afterward.
If there is a space in the file name, you need to enclose it in quotation marks. For example, for a file called "Pickles are Good.txt", you would type Pickles" "are" "Good.txt" in the Command Prompt window
Step 6. Enter the destination directory
Type in another directory (eg C:\Users\[you]\Desktop where you want to copy files to.
If you don't add a directory, the files will be copied to your user directory (eg "C:\Users\[you]") automatically
Step 7. Press Enter key
After that, the file will be copied to the specified directory. You can view the copied files by visiting the directory in the File Explorer program.
Part 3 of 3: Copying Folder Contents
Step 1. Visit the folder directory
Type cd followed by a space, then type the directory of the respective folder and press Enter.
For example, if you want to copy all the files in the " Example " folder on your desktop, type C:\Users\humpb\Desktop into the Command Prompt window
Step 2. Enter the robocopy command
Type robocopy and add a space, without directly pressing Enter.
Step 3. Enter the folder name
Type in the name of the folder you want to copy and add a space after it. Again, don't press Enter immediately afterward.
As with file names, you need to use quotation marks to enclose spaces in folder names
Step 4. Enter the destination directory
Type in the directory you want to copy the contents of the folder to.
If there are a lot of files in the source folder, the destination folder will look messy because the source folder itself won't be copied along with the files
Step 5. Press Enter key
After that, the contents of the folder will be copied to the destination folder.
Tips
- You can copy all files in the directory by typing copy *[file type] (eg copy *.txt).
- If you want to create a new destination folder for the copied files, enter the directory for the new destination folder (including the destination folder itself) after the "robocopy" command.
- If you copy the contents of an existing folder on the Desktop to a new folder, the folder will be named as "Desktop".