12/18/2015 - Hello! We're excited to announce that Mental Works Computing Software will soon be featuring

12/11/2015 - We're going to announce Dr.Batcher 3.0 Alpha with batch files debugger support soon. If you want to start...

News history...


Rob van der Woude:
"Mental Works Computing Software has created a nice tool for...

Andrew Jaritsyn:
“I used to write batch files with the help of Notepad, but...

Steve H.:
“This tool helped me to write some batch files in a couple...



Replaces/updates file(s) with other file(s).


REPLACE [Drive1:][Path1]FileName [Drive2:][Path2] [/a] [/p] [/r] [/w] [/s] [/u]

[Drive1:][Path1]FileName – source file(s). Wildcards (?, *) are allowed.

[Drive2:][Path2] – destination folder for replacement(s).

/a – adds new files instead of replacing the existing ones. Not for use with /s and /u switches.

/p – prompts for confirmation before replacing each file.

/r – replaces read-only and not protected files.

/w – waits for disk to be inserted before replacing files.

/s – includes all subfolders to the destination.

/u – update mode: replaces only files that are older than the source.


Options /a and /s, /u cannot be used together: you can use /a or /s and /u, but not all three of them at the same time.

If you try to replace read-only files without specifying /r option, you’ll see the error message.

If you don’t specify /w option, the replacing starts immediately after you press ENTER. Use /w option for floppy disks.

You can check the result of REPLACE command execution by checking ERRORLEVEL:


Update some data files with asking permissions:

REPLACE a:\*.dat c:\Work /p


Subscribe batch files programming newsletter (no spam):