Click to See Complete Forum and Search --> : Batch file +sync folder


bob_the_builder
July 3rd, 2006, 03:32 AM
Hi,

I have a batch file that syncs 2 folders .. The problem is that part sits in a *.bat file and then the rest gets typed into command prompt.

Code:

sync.bat

XCOPY "%1" "%2" /D /I %3
XCOPY "%2" "%1" /D /I %3


Then type into command prompt:

sync C:\test D:\test /S

I have been trying to put all the code into a single batch file so one can double click it and have it perfom the sync.

Does anyone know how this can be done?

Thanks

Bob

PeejAvery
July 7th, 2006, 09:05 PM
Well, you would have to make a recursive folder search to compare the files but that cannot be done in DOS. You will have to use a different language than DOS. Sorry, you won't be able to sync perfectly in DOS.

rodamis
October 6th, 2009, 10:04 PM
Not True,
This can be done by adding the /S switch to the end of the command.

If I get to it, I'll add an example.