Computing.Net > Forums > Programming > synchronise 2 folder structures using batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

synchronise 2 folder structures using batch

Reply to Message Icon

Name: gman8
Date: October 26, 2009 at 05:32:43 Pacific
OS: Windows XP
Product: Nt / Batch
Subcategory: Batch
Comment:

I have 2 directory structures (FOLDER_A and FOLDER_B) containing files and subdirectories.

I have a text file with a list of the files (full path names) from the 2 structures divided up into the following 3 lists:

LIST#1: files with same name that exist in both FOLDER_A and FOLDER_B but have different content.

LIST#2: folders and files that exist only in FOLDER_A

LIST#3: folders and files that exist only in FOLDER_B

What I need is a batch file that can do the following:

OVERWRITE FOLDER_A files in LIST#1 with FOLDER_B files.
DELETE FOLDER_A files form LIST#2
COPY files in LIST#3 from FOLDER_B over to FOLDER_A

Can anyone help with this please?

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: tvc
Date: November 8, 2009 at 08:44:03 Pacific
Reply:

Have a look at XCOPY, XXCOPY and ROBOCOPY
I would think you can do what require, via these commands (with the correct parameters of course)

Just a question, but aren't you doing a full synch, from FOLDER_B to FOLDER_A ???

Because, you are updating all different files, and removing the files that would only exist in FOLDER_A ... that sounds like synching to me. Check the CLONE option of XXCOPY, or similar options with ROBOCOPY


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: synchronise 2 folder structures using batch

Using batch script print filenames in folder www.computing.net/answers/programming/using-batch-script-print-filenames-in-folder-/19171.html

Rename multiple iles in folder using Batch www.computing.net/answers/programming/rename-multiple-iles-in-folder-using-batch/19638.html

deleting folders - use batch prog www.computing.net/answers/programming/deleting-folders-use-batch-prog/11998.html