sync two folders using dos script and Scheduler

  • Thread starter Thread starter Adam
  • Start date Start date
A

Adam

Hi all,

does anyone know where I can get a script that will sync two folders by
using dos ? I don't want to have to install a sync program, but would rather
execute a dos script each night.

any ideas ?

cheers,

Adam
 
What OS are you using? Windows 2000 has some extra flags for xcopy etc. Is
the synchronisation one way or two way (eg. the newest files from each
folder get copied to the other folder).
 
On win2k it can be achieved with xcopy like this

syncdir.bat
==========================
@echo off
xcopy /d /y /o /s /x /h /c dira\*.* dirb
xcopy /d /y /o /s /x /h /c dirb\*.* dira
exit
==========================
/d - copies only if the source is newer
/y - suppress prompts (always yes)
/o - copies file ownership and ACL information
/x - copies file audit settings
/h - copies system and hidden files
/c - continue even if there is an error

This will copy the newest files from each directory to the other. It is very
crude, but would work as an interim solution.
 
Thanks Derek, sounds good to me !

WebWomble said:
On win2k it can be achieved with xcopy like this

syncdir.bat
==========================
@echo off
xcopy /d /y /o /s /x /h /c dira\*.* dirb
xcopy /d /y /o /s /x /h /c dirb\*.* dira
exit
==========================
/d - copies only if the source is newer
/y - suppress prompts (always yes)
/o - copies file ownership and ACL information
/x - copies file audit settings
/h - copies system and hidden files
/c - continue even if there is an error

This will copy the newest files from each directory to the other. It is very
crude, but would work as an interim solution.
 
Back
Top