+ Post New Thread
Results 1 to 4 of 4
Windows Thread, Script to copy files en mass from folder to folder in Technical; Can anyone help me with a batch script to copy some files from folder to folder en masse? We have ...
  1. #1
    Zoom7000's Avatar
    Join Date
    Feb 2006
    Location
    London
    Posts
    958
    Thank Post
    309
    Thanked 86 Times in 57 Posts
    Rep Power
    33

    Script to copy files en mass from folder to folder

    Can anyone help me with a batch script to copy some files from folder to folder en masse?

    We have a 2 root folders. The first is called "ControlledTests" and in that folder we have 150 home folders called "control01" - "control150". The 2nd root folder is called "HistoryTests" and in that folder we have 150 home folders called "History001" - "History150". What I want to achieve is to copy the contents of each "ControlledTests" home folder in to the respective "HistoryTests" home folder. So:

    Contents of "control01" copied in to "History001"
    Contents of "control02" copied in to "History002"
    Contents of "control03" copied in to "History003"
    Contents of "control04" copied in to "History004"

    etc...

    Any help is very much appreciated!

  2. #2

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,060
    Thank Post
    889
    Thanked 1,732 Times in 1,495 Posts
    Blog Entries
    12
    Rep Power
    454
    Use robocopy or this

    CODE:

    Code:
    robcoopy "C:\Source" "C:\Destination" /MIR
    If your still on XP / 2003 you will need to install this on the machine you are doing the action: http://www.microsoft.com/download/en...ng=en&id=15326
    Last edited by FN-GM; 25th April 2012 at 09:58 AM.

  3. #3


    Join Date
    May 2009
    Posts
    3,152
    Thank Post
    278
    Thanked 857 Times in 641 Posts
    Rep Power
    335
    I don't think robocopy will do the rename of the directories. I can't think of an easy way to do the leading zero's in a batch file - although you can probably look at this thread and figure something out. When I have something like this that is a one off, I tend to use excel to generate the data I need and use the concatenate function too produce a single column containing the final commands I want. It's not particularly re-usable but I can complete the task in a few minutes so it's reasonably efficient for one off's.

  4. #4

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,060
    Thank Post
    889
    Thanked 1,732 Times in 1,495 Posts
    Blog Entries
    12
    Rep Power
    454
    Sorry didnt notice that. Yo shoud use the rename command then setup the commands for every folder in Excel. I did this last month.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 5
    Last Post: 17th September 2009, 10:52 PM
  2. How to copy files from two domains
    By timbo343 in forum Scripts
    Replies: 5
    Last Post: 18th February 2008, 09:43 PM
  3. Failed to copy files from CD
    By Dos_Box in forum Learning Network Manager
    Replies: 13
    Last Post: 12th April 2007, 10:42 AM
  4. Replies: 19
    Last Post: 20th June 2006, 03:53 PM
  5. script to copy files to machines
    By browolf in forum Scripts
    Replies: 1
    Last Post: 28th November 2005, 10:28 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •