REPLACE: Smarter File Copying

If there was such a thing as a Most Underrated Command award, REPLACE would win it hands down. This command, which you almost never hear about, can do three very useful (and very different) things:

• It copies files, but only if their names match those in the target directory.

• It copies files, but only if their names don’t exist in the target directory.

• It copies files, but only if their names match those in the target directory and the matching files in the target directory are older than the files being copied.

Here’s the syntax:

REPLACE source_files target /A /U /P /R /S /W

source_files

The path and file specification of the files you want to copy.

target

The folder to which you want to copy the files.

/A ...

Get Windows 8 In Depth now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.