Solved

Need a Batch file to copy a folder from 1 location to another.

Posted on 2008-06-18
5
1,711 Views
Last Modified: 2010-04-21
I would like to create a batch file to copy files from one share to another share. OS's involved Win2000/xpPro and w2003

I have tried as a test from my local machine
@echo off
xcopy c:\folder \\server\share\folder with no success
Copying the folder the same drive in a different folder is not a problem.

Any help or insight would be greatly appreciated.

Thanks
0
Comment
Question by:mcse63
  • 3
  • 2
5 Comments
 
LVL 38

Accepted Solution

by:
Shift-3 earned 250 total points
ID: 21813413
Robocopy, from the Server 2003 Resource Kit, is generally a better option for copying directories and large amounts of data.
http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd

But if you want to use XCOPY then the below should work.


@echo off

xcopy "c:\folder\*.*" "\\server\share\folder\" /E /C /H /R /Y /Z

Open in new window

0
 

Author Comment

by:mcse63
ID: 21813593
I have tried the above code and the folder is not being copied. I tried a few variations but nada. I should also point out that I would like to be able to run this from my local machine. ie. an desktop shortcut. I am currently mapped to the drive that I want to copy the folder to and have admin permissions.

thanks,
0
 
LVL 38

Expert Comment

by:Shift-3
ID: 21813765
Are you able to create a folder on that share and copy files to it through Windows Explorer?

Either run the script from the command line or add a "pause" line to the end.  What error do you get?
0
 

Author Comment

by:mcse63
ID: 21814035
I can create and or copy without a problem.

I use commmand line and get invalid number of parameters.
0
 

Author Closing Comment

by:mcse63
ID: 31468362
Thanks for the help, there was a dns issue, once I put in the ip it worked without a hitch.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now