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

  1. How to Copy Files in Command Prompt Picture 1
    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.
    1. 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.
    2. 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.
    3. 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.
  2. How to Copy Files in Command Prompt Picture 2
    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.
  3. How to Copy Files in Command Prompt Picture 3
    Open Start
    How to Copy Files in Command Prompt Picture 4
    . Click the Windows logo in the bottom-left corner of the screen.
  4. How to Copy Files in Command Prompt Picture 5
    Type in command prompt. Doing so will search your computer for the Command Prompt program.
  5. How to Copy Files in Command Prompt Picture 6
    Click
    How to Copy Files in Command Prompt Picture 7
    Command Prompt. It's at the top of the Start window. Doing so will open the Command Prompt program.
    1. 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

  1. How to Copy Files in Command Prompt Picture 8
    Enter the "change directory" command. Type in cd followed by a space, but don't press Enter.
  2. How to Copy Files in Command Prompt Picture 9
    Type in your file's directory. Enter the directory in which the file that you want to copy is located.
  3. How to Copy Files in Command Prompt Picture 10
    Press Enter. Doing so will reset Command Prompt to look in the entered directory.
  4. How to Copy Files in Command Prompt Picture 11
    Enter the "copy" command. Type in copy followed by a space, but don't press Enter yet.
  5. How to Copy Files in Command Prompt Picture 12
    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.
    1. 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.
  6. How to Copy Files in Command Prompt Picture 13
    Enter a destination directory. Type in another directory (e.g., C:Users[you]Desktop into which you want to copy the file.
    1. If you don't do this, the file will be copied to your user directory (e.g., "C:Users[you]") by default.
  7. How to Copy Files in Command Prompt Picture 14
    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

  1. How to Copy Files in Command Prompt Picture 15
    Go to the folder's directory. Type in cd followed by a space, then type in the folder's directory and press Enter.
    1. 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.
  2. How to Copy Files in Command Prompt Picture 16
    Enter the robocopy command. Type in robocopy and then a space, but don't press Enter yet.
  3. How to Copy Files in Command Prompt Picture 17
    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.
    1. As with file names, you'll need to use quotes around any spaces in the folder name.
  4. How to Copy Files in Command Prompt Picture 18
    Enter a destination. Type in a directory into which you want to copy the folder's files.
    1. 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.
  5. How to Copy Files in Command Prompt Picture 19
    Press Enter. Doing so will copy the contents of the folder into your destination folder.
4 | 2 Vote
« PREV : How to Change...
How to Change a... : NEXT »