Using XCOPY to Synchronize Folders

While there are many more advanced tools for synchronizing folders, one very useful method (on Windows OS) is to use the XCOPY command. The XCOPY command has been part of the windows suite since the DOS days, and provides a helpful set of options that the standard COPY command does not.

If you are in an environment where you have several mobile devices generating content that you would like stored on a central server for backup and group collaboration, the XCOPY command can be a simple solution for performing regular migrations of the new / updated content on your mobile device.

The XCOPY command for copying the updates from one folder to another is as follows:

C:\> XCOPY C:/SOURCE D:/DESTINATION /E /D /C /Y

The flags used in the above example define:

  • /E
    This flag causes all folders and sub-folders to be copied
  • /D
    This flag causes a DATE comparison to be made, only copying items that are newer than the DESTINATION item. If the DESTINATION is older, or does not contain the file, then it will be copied.
  • /C
    This flag tells XCOPY to continue if it encounters an error - typically errors occur with read-only files, or files that have protected permissions
  • /Y
    This flag tells XCOPY to suppress prompting you for confirmation, which is necessary if you intend to create an automation script or scheduled task

If you wish to automate this process, the easiest method is to create a BATCH file and then create either a SCHEDULED TASK, WINDOWS USER LOGIN SCRIPT or a SHORTCUT to the batch file that you would manually run when you connect your device.

To create a BATCH file, you will:

  1. Open Notepad
    Start -> Accessories -> Notepad
  2. Type or Copy the following into the blank document
    @echo OFF
    echo :
    echo : XCOPY Batch Process Started
    echo :
    xcopy {SOURCE_PATH} {DESTINATION_PATH} /E /D /C /Y
    echo :
    echo : XCOPY Batch Process Complete
    echo :
  3. Save the file as XCOPY_AUTO.BAT somewhere where you can find it. If you don't know where to put it, just save it on your desktop.

Scheduled Tasks and Login Scripts are a bit harder and if you've gotten this far, you should be able to perform a google and find instructions for further automation.

Good Luck and Happy Coding!

 


<<<<<<< HEAD


Was this answer helpful?

 Print this Article

Disqus this...

comments powered by Disqus

or Comment on Facebook

=======
  • Email, SSL
  • 28 Users Found This Useful
Was this answer helpful?
>>>>>>> v7.2.3-release.1

Related Articles

ShowMan Disk Space Usage Graph Visualizer

Disk Space Analyzer and Disk Usage Graph Years ago when I received my first computer, I started...

Best Disk Analyzer Software

Disk Analyzer Softwares and their download locations:SpaceSniffer - a standalone application...

Transition from TextPad to Notepad++

This cheatsheet is for Textpad users that for whatever reason may find themselves, after years of...

Share Keyboard and Mouse with InputDirector

InputDirector is a FREE application for Windows that allows you to share the keyboard and mouse...

Charging Apple iPhone Without Apple iTunes Installed

The Apple iPhone is pretty cool, but with it comes this pain in the neck software called Apple...