Computing.Net > Forums > Windows XP > Batch files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch files

Reply to Message Icon

Name: bennylynch
Date: November 19, 2007 at 17:06:55 Pacific
OS: Windows XP Pro
CPU/Ram: 1GB
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: aegis
Date: November 19, 2007 at 17:40:44 Pacific
Reply:

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


0

Response Number 2
Name: wanderer
Date: November 19, 2007 at 17:55:07 Pacific
Reply:

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.txt

As 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


0

Response Number 3
Name: Mechanix2Go
Date: November 19, 2007 at 20:10:17 Pacific
Reply:

"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



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Batch files

Batch file www.computing.net/answers/windows-xp/batch-file/180885.html

Auto folder Batch file www.computing.net/answers/windows-xp/auto-folder-batch-file/145055.html

simple batch file www.computing.net/answers/windows-xp/simple-batch-file/149160.html