Batch - If, ElseIf, Else

前端 未结 6 706
谎友^
谎友^ 2021-01-07 18:55

Whats wrong with this code?

IF \"%language%\" == \"de\" (
    goto languageDE
) ELSE (
    IF \"%language%\" == \"en\" (
    goto languageEN
) ELSE (
    ech         


        
6条回答
  •  说谎
    说谎 (楼主)
    2021-01-07 19:24

    batchfiles perform simple string substitution with variables. so, a simple

    goto :language%language%
    echo notfound
    ...
    

    does this without any need for if.

提交回复
热议问题