Batch - If, ElseIf, Else

前端 未结 6 707
谎友^
谎友^ 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:21

    @echo off title Test
    echo Select a language. (de/en) 
    set /p language=
    
    IF "%language%" == "de" (
       goto :languageDE 
       ) ELSE IF "%language%" == "en" ( 
       goto :languageEN 
      ) ELSE (
       echo Not found. )
    
    :languageDE 
       echo welcome ,you selected the jarmni langauge 
       goto :eof
    
    :languageEN 
       echo welcome ,you selected the english langauge 
       goto :eof
    

提交回复
热议问题