Solved

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

Posted on 2008-06-18
5
1,712 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

920 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

15 Experts available now in Live!

Get 1:1 Help Now