i need specific details about a btch file cmd

December 4, 2010 at 11:55:36
Specs: Windows Vista
alright so im writing a program that makes the person have to do a math question to access the site i will disguise the program as. my code is as follows...
@echo off
color 64
echo before I can open Google chrome you must answer one question.
pause
echo what is 13x4?
set input =
set /p input=please input answer here
if %input%==52 goto A
if %input%==(xx) goto B

:A
Answer Correct!
Pause
Start chrome.exe
:B
echo sorry, that is incorrect. please try again

now when they get the answer correct i want the program to open but if they get it wrong i want it to close. where i have (xx) i need that to be any number but 52. i want any number typed in except 52 to close the program.


See More: i need specific details about a btch file cmd

Report •

#1
December 4, 2010 at 12:05:58
@echo off
color 64
echo before I can open Google chrome you must answer one question.
pause
echo what is 13x4?
set input =
set /p input=please input answer here
if %input%==52 goto A
goto B
:A
Answer Correct!
Pause
Start chrome.exe
goto :eof
:B
echo sorry, that is incorrect. please try again
"%~0"

Lines changed/added are bold.

How To Ask Questions The Smart Way


Report •

#2
December 4, 2010 at 12:17:48
thank you for the speedy reply. this has fixed most of it. but when i type in 52 it still says it is incorrect until i hit enter again and it asks me to type it in, then it opens the computer. i also want the prompt to close once ive gotten the answer right or wrong. would i just add a close prompt at the end of both A and B?

Report •

#3
December 4, 2010 at 12:27:07
wait nvm, i fiddled with the code a bit and everything works now.

Report •

Related Solutions

#4
December 4, 2010 at 12:43:19
@echo off
color 64
echo before I can open Google chrome you must answer one question.
pause
echo what is 13x4?
set input =
set /p input=please input answer here 
if %input%==52 goto A
goto B

:A
echo Answer Correct!
Start chrome.exe
goto :end

:B
echo sorry, that is incorrect. please try again

:end
pause

How To Ask Questions The Smart Way


Report •

#5
December 5, 2010 at 02:02:13
@echo off & setLocal EnableDELAYedeXpansion

set /p F=how much is 16X4 ? && if !F! neq 52 goto :eof
echo do main task


=====================================
Life is too important to be taken seriously.

M2


Report •

Ask Question