How to Copy Files in Command Prompt

Author: Lewis Jackson
Date Of Creation: 10 May 2021
Update Date: 1 July 2024
Anonim
How To Copy The Files and Folders using COMMAND PROMPT DOS By Easy Method|Cmc It Program
Video: How To Copy The Files and Folders using COMMAND PROMPT DOS By Easy Method|Cmc It Program

Content

This article shows you how to use Windows Command Prompt to copy files or folders.

Steps

Part 1 of 3: Prepare before copying

  1. Click the Windows logo in the lower left corner of the screen.
  2. Command Prompt is at the top of the Start window to open the program.
    • Note that you cannot access the Command Prompt if you are on a shared computer (such as a school or public computer).
    advertisement

Part 2 of 3: Copying files


  1. Enter the command "change path". Please type CD and a space, but don't press ↵ Enter right.

  2. Enter the path of the file. This is the step in entering the path to the file to copy.
  3. Press ↵ Enter to ask Command Prompt to access the path you entered.

  4. Enter the command "copy" by typing copy and a space, but don't press it yet ↵ Enter.
  5. Enter a file name. You'll enter the filename followed by a space, don't forget to type the file extension (eg .txt for text files). Do not press ↵ Enter after this step.
    • If there are spaces in the filename, enclose a space in quotes. For example, the file name "Bai tap Toan.txt" will become Bai "" tap "" Toan.txt in Command Prompt.
  6. Enter the path to the destination folder. Please enter a different path (eg C: Users Desktop) you choose to save the file to copy.
    • If this step is not done, the file will be copied to the user folder (eg "C: Users ") by default.
  7. Press ↵ Enter. This will copy the file to the specified directory. You can view the copied file by accessing the folder from File Explorer on your computer. advertisement

Part 3 of 3: Copying folder data

  1. Access the path to the directory. Type CD and a space, then enter the directory path and press ↵ Enter.
    • For example, if you wanted to copy all the files in the "Example" folder stored on the screen, you'd type C: Users humpb Desktop here.
  2. Enter an order robocopy. Type robocopy and a space, but don't press it yet ↵ Enter.
  3. Enter a folder name. Type the name of the folder you want to copy, and add a space. Again, don't press ↵ Enter.
    • As with filenames, spaces in directory names must be enclosed in quotation marks.
  4. Enter the destination folder. Type the path to where you want to save the copied data.
    • If the root directory has lots of files, then copying those files to another folder with a lot of data will be confused because you cannot copy the root directory.
  5. Press ↵ Enter. This will copy the original directory's data to the other folder specified. advertisement

Advice

  • You can copy all of the files in the directory by entering the command copy * (For example: copy *. txt).
  • If you want to create a new destination directory for the copied files, enter the path to the destination directory (including the name of the destination folder) with the "robocopy" command.
  • If you copy the Desktop folder's data to the new folder, the new folder will be renamed "Desktop".

Warning

  • Copying files and folders in the Command Prompt is often dangerous if you don't know how to do it. Don't copy or change any files or folders if you don't know.