To hide the choices Y , N , and C , but display the text Yes , No , or Continue , type the following line in a batch file:. To show both the text and the options used in the previous examples, type the following line in a batch file:.
To set a time limit of five seconds and specify N as the default value, type the following line in a batch file:.
In this example, if the user doesn't press a key within five seconds, choice selects N by default and returns an error value of 2. Otherwise, choice returns the value corresponding to the user's choice. Skip to main content. This browser is no longer supported. Then go up to Save as and save it on your Desktop as "watever. The ". It lets your computer know how and what to save it as. If you did it correctly a "menu looking thing" should appear and ask for a password, then if properly typed and entered another "menu looking thing" should appear and give you some options to choose from.
I am not telling you to do this, and if you do something wrong or even if you did something right and something bad still happens, I am not responsible. On a happier note Download Article Explore this Article Steps. Tips and Warnings. Related Articles. After each press enter.
Anything in parenthesis do NOT type, these are side-notes that tries to explain the steps. Continue doing this pattern until you have enough. Then type:. Continue doing this pattern until you have completed the file. Save this as a. Double click to test your batch file. Felix Vincent. True, type in notepad or notepad. Also, you can use CMD for that with "start Notepad. Yes No. Thanks for the code for the menu template. Saved me some time. Get the code. Hello all, This is an example of a batch file menu I created a few years back.
You can add or delete menu items as needed and please let me know if you need any help. Source Code This script has not been checked by Spiceworks.
Please understand the risks before using it. Selection 1 ECHO 2. Selection 2 ECHO 3. Selection 3 ECHO 4. Selection 4 ECHO 5.
0コメント