I need to replace all occurrences of several characters in an argument to batch file:
helper.bat
@echo off echo %1 call:replace_newline_characters_and_additional_quotes arg %%1 echo %arg% goto:eof :replace_newline_characters_and_additional_quotes set in=%2 set tmp=%in:\n=|% set %1=%tmp:""=\"% goto:eof Run it as
helper "1""2\n3"
Output
"1""2\n3"
"3"" is not recognized as an internal or external command, operable program or batch file
What am i doing wrong?
|?"1\"2|3"?