Nov 18 2014

How to Copy Only New Files and Changed Files With XCopy on Windows

Category: WindowsFatih Acar @ 17:42

If you want to copy only new files or changed files, you can use xcopy command in batch script file on Windows system.

Copy Only New Files and Changed Files With XCopy

set SourceDir=D:\Source
set TargetDir=F:\Target
xcopy %SourceDir% %TargetDir% /i /d /y

/i /d /y parameters provide that copy only new files and changed files. These detect file modify time changes , but do not notice size changes.

98,840 total views, 170 views today

Tags: System Administration, Windows Batch Script, Windows Server

facebook comments:

2 Responses to “How to Copy Only New Files and Changed Files With XCopy on Windows”

  1. Chuck Swenson says:

    This will fail if you have new directories – xcopy ignores them by default. To copy everything, including new directories, you should add the /e switch:
    Also, if you have spaces in your directory names, you need to enclose them in double quotes. So:
    Set SourceDir=”D\My Source\stuff”
    Set TargetDir=”F:\My Backup\stuff”
    xcopy %SourceDir% %TargetDir% /i /d /y /e

  2. 33Lacy says:

    I must say it was hard to find your page in google.
    You write great articles but you should rank your website higher in search engines.
    If you don’t know how to do it search on youtube: how to
    rank a website Marcel’s way

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.