Batch file to copy certain files from list to destination preserving directory structure, robocopy?

Posted on 2007-10-13
Last Modified: 2008-01-09
I have a list of files that I would like to create a batch file using copy, xcopy, xxcopy or robocopy. I have tried all of the above and can't seem to figure a way to preserve the file path. I need to copy only the files in the list and to create the directory structure as it exists in the source.

I have tried copy g:\dir1\dir1001\filename g:\copydir1\dir1001\filename

all of these assume the file name is also a directory, robocopy seems to allow placing the file name on a separate line in the batch file but I can't seem to get that right either.

running XP pro SP2, I have cygin available if there is something that will work.
Question by:NoelAlford
    1 Comment
    LVL 5

    Accepted Solution

    I would recommend using this version on rysnc it is designed for windows.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    This is an explanation of a simple data model to help parse a JSON feed
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    728 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

    20 Experts available now in Live!

    Get 1:1 Help Now