Copy files from one folder hierarchy to an other

svjensen

Board Regular
Joined
Jun 10, 2009
Messages
118
I need to copy all files from one folder hierarchy to an other.

An example:
My source is in 'c:\1' which has a number of subfolders, some of which have subfolders, etc. Along the lines of:
c:\1
c:\1\a
c:\1\b
c:\1\b\1
c:\1\c
c:\1\c\1
...

All files have to be copied to 'c:\2' and go to the same folder as they come from. If the folder does not exist it should be created.

Is there an easy way to do this, or do I have to loop through all folders and subfolders, and do them one at a time?

/Soren
 
If you are referring to my post then yes this is an alternative answer to your query which copies the files from C:\1 to C:\2

You can read up on the xcopy switches (for example to prompt before overwriting files, to copy files changed after a particular date etc ) at http://support.microsoft.com/kb/289483

Cheers

Dave
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top