How to Copy Files in Command Prompt
Prepare before copying
Determine the location of the file. You need to know the file's location - also known as the path - so Command Prompt knows where to find the file.
You can find the file's path by going to the file's location in File Explorer and clicking the path bar near the top of the window.
Most files have the following path: [Drive name]:Users[User name] (For example "C:UsersKhanh"). This is the path to the location where most files created by computer users are saved.
The file saved on the computer screen related to the above example will be "C:UsersKhanhDesktop", while the file in the Documents folder will have the path "C:UsersKhanhDocuments"
Remember file names. If you want to copy a file, you need to know the name of the file. Note, file names in Command Prompt are case sensitive, so you need to enter the exact spelling of each character.
Open Start by clicking the Windows icon in the bottom left corner of the screen.
Type command promptto find the Command Prompt program on your computer.
Click Command Prompt at the top of the Start window to open this program.
Note, you cannot access Command Prompt if you are using a shared computer (such as a computer at school or in a public place).
Copy files
Enter the command "change path". Type cdin a space, but don't press it ↵ Enterright away.
Enter the path of the file. This is the step to enter the path to the file to copy.
Click ↵ Enterto ask Command Prompt to access the path you just entered.
Enter the "copy" command by typing copyand a space, but don't rush to press ↵ Enter.
Enter a file name. You will enter the file name followed by a space, don't forget to enter the file extension (such as .txtfor text files). Do not press ↵ Enterafter this step.
If there are spaces in the file name, you need to enclose the space in quotation marks. For example, the file name "Bai tap Toan.txt" will become Bai" "tap" "Toan.txtin Command Prompt.
Enter the path to the destination folder. Enter another path (such as C:Users[tên của bạn]Desktop) of your choice to save the file to copy.
If you don't do this, the file will be copied to the user folder (e.g. "C:Users[your name]") by default.
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.
Copy the folder's data
Access the path to the folder. Type cdin a space, then enter the path to the folder and press ↵ Enter.
For example, if you want to copy all the files in the "Example" folder saved on your desktop, you would enter it C:UsershumpbDesktophere.
Enter command robocopy. Type robocopyin a space, but don't rush to press ↵ Enter.
Enter a folder name. Type the name of the folder you want to copy, then add a space. Again, don't rush to press ↵ Enter.
Similar to file names, spaces in folder names must be enclosed in quotation marks.
Enter the destination folder. Type the path to where you want to save the copied data.
If the root folder has many files, copying those files to another folder that already has a lot of data will make you confused because you cannot copy the original folder.
Press ↵ Enter. This will copy the original folder's data to another specified folder.
You should read it
- How to use the command history function in Command Prompt
- Add Command Prompt to Power User Menu on Windows 10
- How to open Command Prompt on Windows 10, 8, 7, Vista and XP
- How to Make Command Prompt Appear at School
- 6 Best Command Prompt Alternatives for Windows
- How to use Xcopy command in Command Prompt
- Instructions for using Command Prompt
- All Frequency Restart, Shutdown, Remote Off ... with Command Prompt
- Windows prompt
- How to Customize the Font in Windows Command Prompt
- How to Unblock Command Prompt Anywhere
- How to Create a Custom Windows Command Prompt