Use a Windows batch file to copy folders with this user-friendly guide

Have you ever tried to copy an entire folder with a Windows batch file? The following method will show you how to copy a folder from one location to another with a batch file.

Steps

  1. 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. 2
    Save the file with .BAT extension.
    Advertisement
  3. 3
    Edit the code in batch file. 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.
  4. 4
    Save the batch file. Save the newly edited batch file and place it anywhere you want.
  5. 5
    Execute the file. Your specified file will be copied from its current location to the one you have specified in the destination address.
  6. Advertisement

Warnings

Advertisement

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 131,601 times.
How helpful is this?
Co-authors: 3
Updated: August 23, 2022
Views: 131,601
Categories: Windows Files
Advertisement