xcopy is one of the most powerful Dos commands of Windows. It is a simple file copy utility, but using arguments you can get a lot more from it.

If you want to update a folder (compared by file dates) using another folder, you can simply use the following arguments of xcopy :

xcopy H:\somefolder\*.* C:\updating\folder\ /s/d/y/h/r/c

Here we are updating C:\updating\folder\ using files in directory H:\somefolder\.

Let’s see what those arguments mean:

  • /s – copy subfolders
  • /d – compare files by date (copy newer changed files only)
  • /y – yes to overwrite and all the questions pc may ask :)
  • /h – copy hidden files too
  • /r – copy readonly files too
  • /c – continue operation on errors

If you want to make this syncronization regularly, you can save this command in a text file called update_C_updating_folder.bat and create a simple task in windows task scheduler to run this script automatically at your desired times.

I hope you found this trick useful. If you want to get notified on more tips like this, please follow my twitter.
All the best and good luck!