Question
Hello! I am a college student taking an INTRODUCTORY Windows 10 Operating System SCRIPTING course and need some help with modifying this script. I need
Hello!
I am a college student taking an INTRODUCTORY Windows 10 Operating System SCRIPTING course and need some help with modifying this script.
I need to convert the entire batch file to use ONE NESTED IF STATEMENT.
NO LABELS IN THE BATCH FILE.
Thanks.
@ECHO off
SET ANS=%1
IF "%ANS%"=="" GOTO NOTHING
IF /I "%ANS%"=="B" GOTO BLUE
IF /I "%ANS%"=="G" GOTO GREEN
IF /I "%ANS%"=="R" GOTO RED
IF /I "%ANS%"=="Y" GOTO YELLOW
ECHO.
ECHO INVALID ENTRY, PLEASE REENTER
GOTO QUIT
:NOTHING
ECHO.
Echo You Entered Nothing
Echo Please Reenter
GOTO QUIT
:BLUE
ECHO.
color F1
Echo You picked Blue!
GOTO QUIT
:GREEN
ECHO.
color F2
Echo You picked Green!
GOTO QUIT
:RED
ECHO.
color F4
Echo You picked Red!
GOTO QUIT
:YELLOW
ECHO.
color F6
Echo You picked Yellow!
GOTO QUIT
:QUIT
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started