How to Copy a Folder with Batch File

Prepare a batch file., Save the file with .BAT extension. , Edit the code in batch file., Save the batch file., Execute the file.

5 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: Prepare a batch file.

    Open Notepad and type the following commands in the file. xcopy /s /i "THE FOLDER ADDRESS YOU WANT TO COPY" "DESTINATION LOCATION"
  2. Step 2: Save the file with .BAT extension.

    , You have to make some minor changes in the batch file you just created.

    In the code, type the actual values instead of the capital text.

    For example, if you want to copy a folder named folder1 from D: to E:, then enter D:\folder1 instead of THE FOLDER ADDRESS YOU WANT TO COPY and E:\folder1 instead of DESTINATION LOCATION. , Save the newly edited batch file and place it anywhere you want. , Your specified file will be copied from its current location to the one you have specified in the destination address.
  3. Step 3: Edit the code in batch file.

  4. Step 4: Save the batch file.

  5. Step 5: Execute the file.

Detailed Guide

Open Notepad and type the following commands in the file. xcopy /s /i "THE FOLDER ADDRESS YOU WANT TO COPY" "DESTINATION LOCATION"

, You have to make some minor changes in the batch file you just created.

In the code, type the actual values instead of the capital text.

For example, if you want to copy a folder named folder1 from D: to E:, then enter D:\folder1 instead of THE FOLDER ADDRESS YOU WANT TO COPY and E:\folder1 instead of DESTINATION LOCATION. , Save the newly edited batch file and place it anywhere you want. , Your specified file will be copied from its current location to the one you have specified in the destination address.

About the Author

A

Abigail Ramos

Writer and educator with a focus on practical organization knowledge.

42 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: