PDF download Download Article
Use a Windows batch file to copy folders with this user-friendly guide
PDF download Download Article

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.

  1. Open Notepad and type the following commands in the file.
    • xcopy /s /i "THE FOLDER ADDRESS YOU WANT TO COPY" "DESTINATION LOCATION"
  2. Advertisement
  3. 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. Save the newly edited batch file and place it anywhere you want.
  5. Your specified file will be copied from its current location to the one you have specified in the destination address.
  6. Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

Show More Tips
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

Warnings

Advertisement

You Might Also Like

Copy Files in Command PromptCopy Files in Command Prompt
Copy Files to USB Using CMD Copy Files to a USB Using Command Prompt (CMD)
Write a Batch FileWrite a Batch File
Use the Command Terminal in Windows 10 to Move and Copy Files/Folders Use the Windows 10 CLI to Move & Copy Files or Folders
Copy a Directory Linux Copy a Directory with the cp Command on Linux
Copy a Google Drive Folder on PC or MacCopy a Google Drive Folder on PC or Mac
Run a Batch File from the Command Line on Windows Run a Windows Batch File from the Command Line (CMD)
Use 7Zip to Create Multiple Compressed Folders in One GoEasily Use 7-Zip to Create Multiple Compressed Folders in One Go
Delete a File in Microsoft Windows Using Batch FilesDelete a File in Microsoft Windows Using Batch Files
Create a Folder on a PC3 Easy Ways to Create a New Folder on a Windows PC
Copy Files in Linux Copy Files in Linux: A Complete Guide
Lock a Folder Using a Batch FileLock a Folder Using a Batch File
Use MS DOS Use MS DOS
Merge Text (.Txt) Files in Command Prompt Merge Multiple Text Files in Command Prompt, Notepad, & More
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 169,904 times.
How helpful is this?
Co-authors: 4
Updated: June 14, 2024
Views: 169,904
Categories: Windows Files
Thanks to all authors for creating a page that has been read 169,904 times.

Is this article up to date?

Advertisement