How to use newline character in text in cmd batch?

后端 未结 12 1843
忘掉有多难
忘掉有多难 2020-12-31 07:08

I would like to do

svn commit -m \"\"

But message should have two lines:

Commit by: firstuser
Bug track: 92         


        
12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 07:23

    Additional example to @jeb's answer

    answer:

    set br= ^
    <
    > <
    >

    example:

    @echo off
    setlocal enableExtensions enableDelayedExpansion
    rem cd /D "%~dp0"
    set br= ^
    
    
    rem br, can't be saved to a var. by using %..%;
    
    
    set "t=t1!br!t2!br!t3"
    
    for /f "usebackq tokens=* delims=" %%q in ('!t!') do (
        echo %%q
    )
    
    
    :scIn
    rem endlocal
    pause
    rem exit /b
    

    ; output:

    t1
    t2
    t3
    Press any key to continue . . .
    

提交回复
热议问题