|< Day Day Up >|| |
Replaces files in the destination folder with files in the source folder that have the same name. It also can be used to add files to the destination folder that don't already exist there. For example, if you need to make sure that all files on an optical disc have been copied to a folder on the hard drive, you could use another method to copy them again, and then get the prompt to overwrite existing files. Using REPLACE with the /a switch automatically copies only files that don't exist on the destination folder while ignoring those files that do exist there.
To replace files or folders, type REPLACE followed by the path to the source files or folders, then the destination files or folders, followed by any appropriate switches. You can also navigate to the source folder before running the command. If you specify neither a source nor a destination folder, the current folder is used.
/a: Adds only files to the destination folder that aren't there already; /a cannot be used at the same time as the /s or /u switches.
/p: Prompts you for confirmation before replacing or adding a file or folder.
/r: Replaces read-only, hidden or system files or folders. Files or folders in the destination folder with these attributes normally would cause the operation to stop.
/w: Waits for you to insert a disk before searching for source files or folders. Without this switch, REPLACE attempts to replace or add files immediately after the user presses <ENTER>.
/s: Includes subfolders of the destination folder (not the source folder); /s cannot be used at the same time as the /a switch.
/u: Replaces only those files in the destination folder that are older than those with the same names in the source folder; /u cannot be used at the same time as the /a switch; /u cannot be used to update hidden or system files. You'll have to remove these attributes first, using the ATTRIB command or the Windows interface.
|< Day Day Up >|| |