Syntax pattern from Microsoft Learn; replace placeholders and choose only one documented alternative before use.
replace [<drive1>:][<path1>]<filename> [<drive2>:][<path2>] [/a] [/p] [/r] [/w]Replace existing files in a directory. This guide lists the documented syntax and parameters for replace; check Microsoft Learn for version, role and execution-context requirements.
replace [<drive1>:][<path1>]<filename> [<drive2>:][<path2>] [/a] [/p] [/r] [/w]
replace [<drive1>:][<path1>]<filename> [<drive2>:][<path2>] [/p] [/r] [/s] [/w] [/u]The linked Microsoft Learn article is the upstream authority. Availability may depend on Windows release, role, optional feature or interactive tool context.
Syntax pattern from Microsoft Learn; replace placeholders and choose only one documented alternative before use.
replace [<drive1>:][<path1>]<filename> [<drive2>:][<path2>] [/a] [/p] [/r] [/w]| Option / clause | Description |
|---|---|
[<drive1>:][<path1>]<filename> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
[<drive2>:][<path2>] | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
<drive1> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
<path1> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
<filename> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
<drive2> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
<path2> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
/a | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/p | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/r | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/w | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/s | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/u | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.