Search code examples
batch-filebatch-processingbatch-rename

How to use fnr.exe?


I'm using fnr.exe (https://findandreplace.codeplex.com).

I have it in a bat file. The file I'm working on is in the same folder as the bat file. I've tried the following:

fnr.exe --cl --find "text1" --replace "text2" --dir "\" --fileMask "app.config"

but get this error:

--fileMask required option is missing

Any one know what I'm doing wrong?


Solution

  • Without knowing the program I can't be sure, but the standard rules to process command line arguments will see your command line as

                                                         | Here is the problem
                                                         v
    fnr.exe --cl --find "text1" --replace "text2" --dir "\" --fileMask "app.config"
    (.....) (..) (....) (.....) (.......) (.....) (...) (.........................)
    

    A single backslash followed by a quote is a escaped quote that is included in the argument.

    Try with

    fnr.exe --cl --find "text1" --replace "text2" --dir "\." --fileMask "app.config"