Jump to content

Script to copy files en mass from folder to folder


Recommended Posts

Posted

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!

Posted
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.
Posted
Sorry didnt notice that. Yo shoud use the rename command then setup the commands for every folder in Excel. I did this last month.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...