Command Prompt for Windows




Command REPLACE

Function:

Search and replace a text string in the specified files.

Syntax:

REPLACE [drive:][path]filename "searchfor" "replacewith" [/M] [/S] [/Y]
[drive:][path]filenameSpecifies the text file(s) to search.
seachforSpecifies the text string to replace.
replacewithSpecifies the replacement text string.
/MMatch case.
/SProcess sub-directories.
/YAssume yes for all questions.

Note:

Command REPLACE uses the fast Boyer-Moore Algorithm and will only search text files. Non-text file are simply skipped.

The parameter replacewith is case sensitive. The parameter searchfor is not, unless the /M switch is specified.