bat if else语法

call :agreelic
:agreelic
    :: echo -n "请输入是否同意许可声明:y 同意/n 不同意 "
    set /p isagreee=请输入是否同意许可声明:y 同意/n 不同意:
    echo "%isagreee%"

    if "%isagreee%" == "n" ( 
        echo "输入为N,退出安装程序"
        exit
    ) else if "%isagreee%" == "y" ( 
        echo "已同意许可声明"
    ) else (
        echo "未知的输入" 
        GOTO:agreelic
    ) 
posted @ 2021-06-28 10:34  leechg  阅读(495)  评论(0编辑  收藏  举报