Download Article
Use a Windows batch file to copy folders with this user-friendly guide
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.
Steps
-
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"
-
-
Save the file with .BAT extension.Advertisement
-
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 ofTHE FOLDER ADDRESS YOU WANT TO COPY
andE:\folder1
instead ofDESTINATION LOCATION
.
- For example, if you want to copy a folder named folder1 from D: to E:, then enter
-
Save the batch file. Save the newly edited batch file and place it anywhere you want.
-
Execute the file. Your specified file will be copied from its current location to the one you have specified in the destination address.
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
- There must be a single space between "D:\folder1" and "E:\folder1"Thanks
- Take care of the punctuation in the code.Thanks
- Carefully enter the source and destination addresses in the batch file.Thanks
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
- Carefully enter the specified commands.Thanks
- Don't usually use to copy folders with large data inside them.Thanks
Advertisement
About This Article
Thanks to all authors for creating a page that has been read 165,900 times.
Advertisement