PDF download Download Article PDF download Download Article

Are you really good at programming Batch Files, but you just don't know how to make those yes or no Choices or Menus that list Choices 1, 2, and 3? Well you've come to the correct place!

  1. Advertisement
  2. After each press enter. Anything in parenthesis do NOT type, these are side-notes that tries to explain the steps.
  3. )
  4. )
  5. ~0,1%
  6. Then type:)
  7. Please try again.
  8. 29
    Save this as a .bat file. Double click to test your batch file.
  9. Advertisement


Community Q&A

Search
Add New Question
  • Question
    True or false: you can open Notepad using run options?
    Felix Vincent
    Felix Vincent
    Community Answer
    True, type in notepad or notepad.exe. Also, you can use CMD for that with "start Notepad."
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Example

@ECHO off
cls
:start
ECHO.
ECHO 1. Print Hello
ECHO 2. Print Bye
ECHO 3. Print Test
set /p choice=Type the number to print text.
rem if not '%choice%'=='' set choice=%choice:~0;1% ( don`t use this command, because it takes only first digit in the case you type more digits. After that for example choice 23455666 is choice 2 and you get "bye"
if '%choice%'=='' ECHO "%choice%" is not valid please try again
if '%choice%'=='1' goto hello
if '%choice%'=='2' goto bye
if '%choice%'=='3' goto test
ECHO.
goto start
:hello
ECHO HELLO
goto end
:bye
ECHO BYE
goto end
:test
ECHO TEST
goto end
:end
pause
exit

Tips

Show More Tips
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

Warnings

Advertisement

You Might Also Like

Make a Video Game With CmdMake a Video Game With Cmd
Build a Simple Computer Game Using Batch ScriptBuild a Simple Computer Game Using Batch Script
Make a Command Prompt CalculatorMake a Command Prompt Calculator
Add a Password to a .Bat FileA Complete Guide to Adding Password Protection to .Bat Files
Make a Program Using NotepadMake a Program Using Notepad
Write a Batch FileWrite a Batch File
Make a Game with Notepad3 Cool Ways to Make Your Own Game with Notepad
Delay a Batch File Delay a Batch File: Timeout, Pause, Ping, Choice & Sleep
Run a Batch File from the Command Line on Windows Execute a Batch File from the Command Line (CMD)
Make an Easy E Bomb Using NotepadMake an Easy E Bomb Using Notepad
Create a 'Matrix' Falling Code Batch FileCreate a 'Matrix' Falling Code Batch File
Use Notepad++Use Notepad++
Make a Fake Error Message in WindowsMake a Fake Error Message in Windows
Use CMD (Beginner) Use CMD Command Lines as a Beginner
Advertisement

About This Article

Tested by:
wikiHow Technology Team
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 13 people, some anonymous, worked to edit and improve it over time. This article has been viewed 253,093 times.
How helpful is this?
Co-authors: 13
Updated: July 11, 2022
Views: 253,093
Categories: Programming
Thanks to all authors for creating a page that has been read 253,093 times.

Is this article up to date?

Advertisement