|
Answer» this is my batch so far
Code: [Select]@echo off echo Hello pause echo How are you doing today? echo If you are doing Great type yes and press enter echo If you arent doing great type no and press enter
if '%option%'=='yes' goto :yes if '%option%'=='no' goto :no set /p option=
:yes echo Well that is great! would youlike to play a game? echo If you would like to play a game please type yes and then press enter. pause
if '%option%'=='yes' goto :game if '%option%'=='no' goto :game set /p option=
:game echo Thank you for wanting to play the game! pause echo First i would like to ask you some questions, echo just to get to know you. pause echo First i would like to ask you for your name.
:no echo Awwwwww.....that SUCKS alot...do you want to cheer yourself up with a game? pause well befor the huge space i need to know how to MAKE the batch file TALK back to the person after they input their name......if you can help i would love u forever (nohomo)
Thanx4 helping
~Shnarg~Quote @echo off echo Hello pause echo How are you doing today? echo If you are doing Great type yes and press enter echo If you arent doing great type no and press enter
set /p option= if '%option%'=='yes' goto :yes if '%option%'=='no' goto :no // You cant check for varialbe before its set
:yes echo Well that is great! would youlike to play a game? echo If you would like to play a game please type yes and then press enter. pause
set /p option= if '%option%'=='yes' goto :game if '%option%'=='no' goto :game // You cant check for varialbe before its set
:game echo Thank you for wanting to play the game! pause echo First i would like to ask you some questions, echo just to get to know you. pause echo First i would like to ask you for your name.
set /p name= echo Your name is: %name% pause
:no echo Awwwwww.....that sucks alot...do you want to cheer yourself up with a game? pause is that what you looking for ?? Quote from: devcom on February 28, 2009, 08:20:14 AMQuote@echo off echo Hello pause echo How are you doing today? echo If you are doing Great type yes and press enter echo If you arent doing great type no and press enter
set /p option= if '%option%'=='yes' goto :yes if '%option%'=='no' goto :no // You cant check for varialbe before its set
:yes echo Well that is great! would youlike to play a game? echo If you would like to play a game please type yes and then press enter. pause
set /p option= if '%option%'=='yes' goto :game if '%option%'=='no' goto :game // You cant check for varialbe before its set
:game echo Thank you for wanting to play the game! pause echo First i would like to ask you some questions, echo just to get to know you. pause echo First i would like to ask you for your name.
set /p name= echo Your name is: %name% pause
:no echo Awwwwww.....that sucks alot...do you want to cheer yourself up with a game? pause is that what you looking for ??
ummmmm does it call ppl by their name after they input it throughout the rest of the batch file? REM Ask for input from user SET /P Test= REM On my XP computer "==" is replaced by "EQU" ? REM The following code WORKS
@ECHO OFF :BEGIN ECHO 1 - Stars ECHO 2 - Dollar Signs ECHO 3 - Crosses ECHO 4 - EXIT echo Enter Choice
SET /P Test=
IF %Test% EQU 4 goto EXIT IF %Test% EQU 3 goto CRS IF %Test% EQU 2 goto DLR IF %Test% EQU 1 goto STR
:STR ECHO *******************
echo. pause CLS GOTO BEGIN
:DLR ECHO $$$$$$$$$$$$$$$$$$$$
echo. pause CLS GOTO BEGIN
:CRS ECHO +++++++++++++++++++++
echo. pause CLS GOTO BEGIN :EXIT C:\>type iftest.bat REM On my XP computer "==" is replaced by "EQU" ?
@ECHO OFF
:BEGIN echo Play Game? echo Enter yes or no set /p option=
if %option% EQU yes goto game
if %option% EQU no goto EXIT
:game echo Play pause GOTO BEGIN :EXIT echo Bye C:\>iftest.bat Play Game? Enter yes or no yes Play Press any key to continue . . . Play Game? Enter yes or no no Bye
C:\>Quote from: billrich on February 28, 2009, 12:01:38 PMOn my XP computer "==" is replaced by "EQU" ?
Both are valid.
Code: [Select]C:\>set variable=CAT
C:\>if "%variable%"=="cat" echo yes yes
C:\>if "%variable%" EQU "cat" echo yes yes
|