Multiple choices menu on batch file?

后端 未结 13 1602
盖世英雄少女心
盖世英雄少女心 2020-11-28 12:56

Hi I want to make a batch file menu, that asks \'Select app you want to install?\' for example

  1. App1
  2. App2
  3. App3
  4. App4
  5. App5
相关标签:
13条回答
  • 2020-11-28 13:52

    You want to use set /p Example below:

    echo What would you like to install?
    echo 1 - App1
    echo 2 - App2
    
    set /p whatapp=
    
    if %whatapp%==1 (
        codetoinstallapp1
    ) else if %whatapp%==2 (
        codetoinstallapp2
    ) else (
        echo invalid choice
    )
    
    0 讨论(0)
提交回复
热议问题