How to make menu for cmd script?

Discussion in 'Scripting' started by NST_Adventure, Mar 15, 2020.

  1. NST_Adventure

    NST_Adventure MDL Addicted

    Jun 1, 2019
    694
    114
    30
    Hi i want to make a windows batch file
    But i dont know how to make good interactive menu ...
    Can someone show me how to make it?

    Thank You! :) ;) ^_^

    Best Regards
    NST_Adventure
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Brother please have a look :
    Code:
    https://www.makebatchfiles.com/
     
  3. LittlePro

    LittlePro MDL Senior Member

    Jan 19, 2017
    345
    117
    10
    #3 LittlePro, Mar 16, 2020
    Last edited: Mar 20, 2020
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. NST_Adventure

    NST_Adventure MDL Addicted

    Jun 1, 2019
    694
    114
    30
    Yeah i mean how do i make script menu Like KMS_VL_AIO???

    Thank You! :) ;) ^_^
    Best Regards
    NST_Adventure
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Windows_Addict

    Windows_Addict MDL Addicted

    Jul 19, 2018
    650
    1,232
    30
    You can open the KMS_VL_AIO with notepad and read it. if you can't do such self-learning then it's better if you give another thought if it's a good decision to enter in script writing.

    It's better to ask a specific problem in a specific step which you can't solve and show what you have done to solve it, Instead of questions like teach me how to write a batch script or how to make a script like KMS_VL_AIO.
     
  6. NST_Adventure

    NST_Adventure MDL Addicted

    Jun 1, 2019
    694
    114
    30
    in short I want to make a menu like kms vl aio but how do you do it?


    Best Regards
    NST_Adventure
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Windows_Addict

    Windows_Addict MDL Addicted

    Jul 19, 2018
    650
    1,232
    30
    How about you start reading the KMS_VL_ALL script menu part and try to apply it, and if you don't understand some part then mention that part and ask.
    or do you want someone to spoon feed you?
     
  8. rpo

    rpo MDL Expert

    Jan 3, 2010
    1,135
    943
    60
    Basically, you have to use the echo, set /p and choice cmd commands.
     
  9. NST_Adventure

    NST_Adventure MDL Addicted

    Jun 1, 2019
    694
    114
    30
    Ok since this need deep understanding i will make video about it

    Best Regard
    NST_Adventure
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. shhnedo

    shhnedo MDL Addicted

    Mar 20, 2011
    765
    992
    30
    This. Plus, you were given a very comprehensive tutorial on how to make a cmd menu that executes basic tasks. If you're still waiting for spoon-feeding - you're taking on the wrong hobby.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    32,090
    50,834
    450
    Don't worry, by this time tomorrow he will be on another quest for info he doesn't understand;)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. NST_Adventure

    NST_Adventure MDL Addicted

    Jun 1, 2019
    694
    114
    30
    I will try them
    Thanks :) ;) ^_^

    Best Regards
    NST_Adventure
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Brother @NST_Adventure please have a look upon this by AveYo :

    Code:
    https://gist.github.com/AveYo/0f9e52da11f490435faa5ec091bd33e9
     
  14. NST_Adventure

    NST_Adventure MDL Addicted

    Jun 1, 2019
    694
    114
    30
    Thanks i will use it soon :)

    Best Regards
    NST_Adventure
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. LittlePro

    LittlePro MDL Senior Member

    Jan 19, 2017
    345
    117
    10
    @NST_Adventure : So, how far you got dear ?

    Did you have a look There!

    It tells us where to start!

    Start with basics. KMS_VL_AIO is not a great idea to start with.

    A batch script largely run multiple commands in a batch, one after other, to accomplish various task(s) & troubleshooting. Don't start with them.

    First of all try to run single commands with .cmd / .bat files.

    For eg.

    (i) Open Notepad & type the following in two lines, one after other

    Code:
    sfc /scannow
    pause
    (ii) Save the file changing the .txt extension to .bat or .cmd

    (iii) double click the file & just see what happens!

    Get a good idea & understanding of the commands, switches & syntax. One day we will be through!

    Thanks. ...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. NST_Adventure

    NST_Adventure MDL Addicted

    Jun 1, 2019
    694
    114
    30
    Hi everyone this is my mistake sorry!

    With this tutorial:
    I successfully create cmd menu but i got another problem :(
    After choose then cmd are execute command

    after that why the menu reappeared twice???
    I have this problem and idk how to resolve this
    :confused:

    Note:
    Not Understand?
    No Worries I Will Drop A SS Later :)

    Best Regards
    NST_Adventure
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. LittlePro

    LittlePro MDL Senior Member

    Jan 19, 2017
    345
    117
    10
    Glad to know that you have got somewhere.

    Share your script so that everybody can look into that.

    Thanks. ...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. notds

    notds MDL Novice

    Mar 25, 2020
    3
    1
    0

    Code:
    @ECHO OFF
    
    CHOICE /C ABCDN /N /T 10 /D C /M "Format drive A:, B:, C:, D: or None?"
    
    IF ERRORLEVEL 1 SET DRIVE=drive A:
    IF ERRORLEVEL 2 SET DRIVE=drive B:
    IF ERRORLEVEL 3 SET DRIVE=drive C:
    IF ERRORLEVEL 4 SET DRIVE=drive D:
    IF ERRORLEVEL 5 SET DRIVE=None
    ECHO You chose to format %DRIVE%
    Syntax:
    CHOICE [ /C choices ] [ /N ] [ /CS ] [ /T timeout /D choice ] [ /M text ]

    Description:
    This tool allows users to select one item from a list of choices and returns the index of the selected choice.
    Parameter List:

    /C choices Specifies the list of choices to be created.
    Default list for English versions is YN
    /N Hides the list of choices in the prompt.
    The message before the prompt is displayed and the choices are still enabled.
    /CS Enables case-sensitive choices to be selected.
    By default, the utility is case-insensitive.

    Note: DOS and NT Resource Kit versions use /S instead
    /T timeout The number of seconds to pause before a default choice is made.
    Acceptable values are from 0 to 9999.
    If 0 is specified, there will be no pause and the default choice is selected.

    Note: DOS and NT Resource Kit versions use /T:default,timeout instead.
    /D default Specifies the default choice after timeout seconds.
    Character must be in the set of choices specified by /C option and must also specify timeout with /T.

    Note: DOS and NT Resource Kit versions use /T:default,timeout instead.
    /M text Specifies the message to be displayed before the prompt.
    If not specified, the utility displays only a prompt.

    The ERRORLEVEL is set to the offset of the index of the key that was selected from the set of choices.
    The first choice listed returns a value of 1, the second a value of 2, and so on.
    If the user presses a key that is not a valid choice, the tool sounds a warning beep.
    If tool detects an error condition, it returns an ERRORLEVEL value of 255.
    If the user presses CTRL+BREAK or CTRL+C, the tool returns an ERRORLEVEL value of 0.
    When you use ERRORLEVEL parameters in a batch program, list them in decreasing order.
     
  19. notds

    notds MDL Novice

    Mar 25, 2020
    3
    1
    0
    Don't listen to this person, they are hazing you. That will be annoying and cost you a bunch of time and will be annoying.