Here another article on command prompt tricks. Here we are going to discuss how to copy and move files using the Windows command prompt.
Here is the Command Prompt section, where you can find lots of command prompt tips and tricks.
How to Copy Files Using Command Prompt
Here in this section, we are going to discuss How to Copy single and multiple files using Command Prompt.
Note: You have to navigate to the directory where you want to perform the task. You can do it by using this command “cd dirextory_name“ or to change drive use the drive name with a colon (E:) this will change the directory to E drive.
Here’s how to copy files using command prompt:
1. Copy a Single File:
Use this command “copy file_name_with_extension folder_name“. For example, I want to copy the note.txt file to the notes folder then I will use this command
copy note.txt notes
2. Copy Multiple Files:
Use this command “xcopy name_of_the_folder_from_where_you_want_to_copy_all_the_files folder_name_where_you_want_to_copy“.
For example, I want to copy all the files of the “sample paper” folder to the “notes” folder then I will use this command
xcopy samplepaper notes
Note: To get help on copy and xcopy command use these command “copy /?” and “xcopy /?“, this will give you all the copy and xcopy commands you can use for various purposes.
How to Move Files Using Command Prompt
Here in this section, we are going to discuss how to move files using the command prompt. For that use this command “move file_with_extension/folder_name folder_name_where_you_want_to_move“.
For example, I want to move samplepaper folder to notes folder then I will use this command
"move samplepaper notes"
Note: To get help on move command use this command “move/?”, this will give you all the move commands you can use for varies purpose.