String replacement in batch file

后端 未结 4 1730
夕颜
夕颜 2020-11-28 22:46

We can replace strings in a batch file using the following command

set str=\"jump over the chair\"
set str=%str:chair=table%

These lines wo

4条回答
  •  清酒与你
    2020-11-28 23:29

    This works fine

    @echo off    
    set word=table    
    set str=jump over the chair    
    set rpl=%str:chair=%%word%    
    echo %rpl%
    

提交回复
热议问题