------------------------ MS-DOS v6.22 Help: REPLACE ------------------------
<Notes> <Examples>                                               <Index>
----------------------------------------------------------------------------

                                  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.

                                      ***

<Syntax> <Examples>
----------------------------------------------------------------------------

                             REPLACE--Examples

Suppose that several directories on drive C contain different versions of a
file named PHONES.CLI, which contains client names and phone numbers. To
replace all of these files with the latest version of the PHONES.CLI file
from the disk in drive A, type the following command:

    replace a:\phones.cli c:\ /s

Suppose you want to add new printer device drivers to a directory on drive C
named TOOLS, which already contains several printer device-driver files for
a word processor. To do this, type the following command:

    replace a:*.prd c:\tools /a

This command searches the current directory on drive A for any files that
have the extension .PRD and then adds these files to the TOOLS directory on
drive C. Because the /A switch is included, REPLACE adds only those files
from drive A that do not exist on drive C.

                                      ***

<Syntax> <Notes>
----------------------------------------------------------------------------

                             REPLACE--Examples

Suppose that several directories on drive C contain different versions of a
file named PHONES.CLI, which contains client names and phone numbers. To
replace all of these files with the latest version of the PHONES.CLI file
from the disk in drive A, type the following command:

    replace a:\phones.cli c:\ /s

Suppose you want to add new printer device drivers to a directory on drive C
named TOOLS, which already contains several printer device-driver files for
a word processor. To do this, type the following command:

    replace a:*.prd c:\tools /a

This command searches the current directory on drive A for any files that
have the extension .PRD and then adds these files to the TOOLS directory on
drive C. Because the /A switch is included, REPLACE adds only those files
from drive A that do not exist on drive C.

                                      ***

----------------------------------------------------------------------------
<Top of page>
Last update: December 07, 2002 14:45 by
Content © 1997 Microsoft Corporation
All else © 2000-2005
Counter