Computing.Net > Forums > Programming > Copy folders, rename file if name duplicated

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Copy folders, rename file if name duplicated

Reply to Message Icon

Name: uokiok
Date: July 21, 2009 at 06:08:53 Pacific
OS: Microsoft Windows XP Home Edition
CPU/Ram: 1.799 GHz / 255 MB
Product: P4vm8 / P4vm8
Subcategory: Batch
Comment:

I have a Documents folder copied from my previous "old" computer that I want to merge with the Documents folder on my current "new" computer. Both folders are large and complex, with many sub-folders, some nested three or four folders deep, and many files within the folders.

The proceedure I want to follow is: if the old folder has the same name as a new folder then copy the contents of the old folder into the new folder. If the folder names are different then simply copy the old folder. If file names are the same then append "old" to the old file name when copying. This needs to apply to sub-folders as well.

Has anyone got any idea how a batch file could do that please?

The normal XP windows copy thing will do the above, including merging the contents of an old folder into a new folder of the same name, except that it cannot rename a file if the old file name is the same as the new file name.




Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


how to merge 2 txt files ... how to add a text in a fi...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Copy folders, rename file if name duplicated

Rename file if it has space and equal signs www.computing.net/answers/programming/rename-file-if-it-has-space-and-equal-signs/19437.html

Renaming Files www.computing.net/answers/programming/renaming-files/15455.html

copy & rename files www.computing.net/answers/programming/copy-rename-files/20135.html