oem.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
REPLACE
Notes  Examples
────────────────────────────────────────────────────────────────────────────
 
                                  REPLACE
 
Replaces files in a destination directory with files in a source directory
that have the same name. You can also use REPLACE to add unique filenames to
the destination directory.
 
Syntax
 
    REPLACE [drive1:][path1]filename [drive2:][path2] [/A] [/P] [/R] [/W]
 
    REPLACE [drive1:][path1]filename [drive2:][path2] [/P] [/R] [/S] [/W]
    [/U]
 
Parameters
 
[drive1:][path1]filename
    Specifies the location and name of the source file or set of files.
 
[drive2:][path2]
    Specifies the location of the destination file. You cannot specify a
    filename for files you replace. If you specify neither a drive nor a
    directory, REPLACE uses the current drive and directory as the
    destination.
 
Switches
 
/A
    Adds new files to the destination directory instead of replacing
    existing files. You cannot use this switch with the /S or /U switch.
 
/P
    Prompts you for confirmation before replacing a destination file or
    adding a source file.
 
/R
    Replaces read-only files as well as unprotected files. If you do not
    specify this switch but attempt to replace a read-only file, an error
    results and stops the replacement operation.
 
/S
    Searches all subdirectories of the destination directory and replaces
    matching files. You cannot use the /S switch with the /A switch. The
    REPLACE command does not search subdirectories specified in path1.
 
/W
    Waits for you to insert a disk before REPLACE begins to search for
    source files. If you do not specify /W, REPLACE begins replacing or
    adding files immediately after you press ENTER.
 
/U
    Replaces (updates) only those files on the destination directory that
    are older than those in the source directory. You cannot use the /U
    switch with the /A switch.
 
Related Command
 
For information about changing file attributes, see the <ATTRIB> command.
 
                                      ♦