Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have created a batch file that copies the contents of one folder to another, however I am looking to copy 3 copies from 3 different folders to 3 different locations within 1 batch file rather than 3.
The following works fine:
xcopy G:\folder\sbfldr1 C:folder\sbfldr1 /s
But I want to do 3 copies in 1 batch file:
xcopy G:\folder\sbfldr1 C:folder\sbfldr1 /s
xcopy G:\folder\sbfldr2 C:folder\sbfldr2 /s
xcopy G:\folder\sbfldr3 C:folder\sbfldr3 /s
But I can't get this to work, what's missing?
Any help appreciated.

Try this:
start xcopy G:\folder\sbfldr1 C:folder\sbfldr1 /s
start xcopy G:\folder\sbfldr2 C:folder\sbfldr2 /s
start xcopy G:\folder\sbfldr3 C:folder\sbfldr3 /s

You troubleshoot batch files one of two ways. You put a pause between each line to see if there are errors. You pipe the batch to a text file and then read the text file for the errors like so:
mybatch.bat >mytextfile.txtAs you have it written here there should not be any reason you can't have all three commands execute.
Imagine the power if you knew how to internet search

"xcopy G:\folder\sbfldr3 C:folder\sbfldr3 /s"
You didn't bother to say what the problem is, but as written, it needs a backslash after C: like this:
xcopy G:\folder\sbfldr3 C:\folder\sbfldr3 /s
Beyond that, you can avoid the dumb question as to whether the destination is a file or folder by including the trailing backslash:
xcopy G:\folder\sbfldr3 C:\folder\sbfldr3\ /s
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |