Logo 
Search:

Dos Articles

Submit Article
Home » Articles » Dos » BatchRSS Feeds

BATCH FILE SHOWING THE USAGE OF CHOICE COMMAND

Posted By: Milind Mishra     Category: Dos     Views: 4500

BATCH FILE SHOWING THE USAGE OF CHOICE COMMAND.

Code for BATCH FILE SHOWING THE USAGE OF CHOICE COMMAND in Dos

@echo off

CLS


REM  CHOICE   HELPS TO GO TO A PARTICULAR LABEL.


REM           BATCH FILE STARTS..............

ECHO  THIS IS BATCH FILE SHOWING THE USE OF CHOICE COMMAND.

ECHO 0.ADDITION.
ECHO 1.SUBTRACTION.
ECHO 2.MULITIPLICATION.
ECHO 3.DIVISION.
ECHO 4.EXIT  

CHOICE /C1234/T:1,10 "ENTER U R CHOICE :"

IF ERRORLEVEL = 4  GOTO QUIT
IF ERRORLEVEL = 3  GOTO D
IF ERRORLEVEL = 2  GOTO M
IF ERRORLEVEL = 1  GOTO S
IF ERRORLEVEL = 0  GOTO A


:D
     SET /A %ANS=2/3
     ECHO  %ANS%
     GOTO EXIT

:M
     SET /A %ANS=2*3
     ECHO %ANS%
     GOTO EXIT

:S
     SET /A %ANS=2-3
     ECHO %ANS%
     GOTO EXIT

:A
     SET /A %ANS=2/3
     ECHO %ANS%
     GOTO EXIT


:EXIT
  
Share: 


Didn't find what you were looking for? Find more on BATCH FILE SHOWING THE USAGE OF CHOICE COMMAND Or get search suggestion and latest updates.

Milind Mishra
Milind Mishra author of BATCH FILE SHOWING THE USAGE OF CHOICE COMMAND is from India.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!