vietboy505
Technical User
IF ELSE STATEMENT
Since there is no else statement in Batch script. How do I by pass that?
I want this script will ask for a name if the name doesn't match the input.
The name will be hardcode, so the person who run it doesn't enter his/her name everything. It just goes directly to check status right away and print out the message.
Why this not working the way I want it?
This will goes through all command even though I try to put in JOHN or DAVE.
How can I covert the user input to all CAPS or the variable %NAME% to all CAPS?
---------
---------------
thanks for the help..
Since there is no else statement in Batch script. How do I by pass that?
I want this script will ask for a name if the name doesn't match the input.
The name will be hardcode, so the person who run it doesn't enter his/her name everything. It just goes directly to check status right away and print out the message.
Why this not working the way I want it?
This will goes through all command even though I try to put in JOHN or DAVE.
How can I covert the user input to all CAPS or the variable %NAME% to all CAPS?
---------
Code:
@ECHO OFF
SET NAME="ENTER_NAME_HERE"
GOTO :START_MENU
:START_MENU
IF %NAME% == "ENTER_NAME_HERE" GOTO :ASK_MENU
:END
:ASK_MENU
SET /P NAME="ENTER NAME: " GOTO :CHECK_MENU
:END
:CHECK_MENU
IF %NAME% == "JOHN" GOTO :JOHN_MENU
IF %NAME% == "DAVE" GOTO :DAVE_MENU
:END
:JOHN_MENU
ECHO YOUR NAME IS: %NAME% HAVE A NICE DAY!
:END
:DAVE_MENU
ECHO YOUR NAME IS: %NAME% PEACE OUT!
:END
PAUSE
---------------
thanks for the help..